mirror of
https://github.com/BreizhHardware/multi-monitors-add-on.git
synced 2026-01-18 16:47:26 +01:00
Fix error: TypeError: Math.trunc is not a function.
This commit is contained in:
@@ -212,6 +212,14 @@ function init(extensionMeta) {
|
||||
let theme = imports.gi.Gtk.IconTheme.get_default();
|
||||
theme.append_search_path(extensionMeta.path + "/icons");
|
||||
|
||||
// for gnome-shell<3.26
|
||||
if (!Math.trunc) {
|
||||
Math.trunc = function(v) {
|
||||
v = +v;
|
||||
return (v - v % 1) || (!isFinite(v) || v === 0 ? v : v < 0 ? -0 : 0);
|
||||
};
|
||||
}
|
||||
|
||||
let metaVersion = MultiMonitors.metadata['version'];
|
||||
if (Number.isFinite(metaVersion)) {
|
||||
version = 'v'+Math.trunc(metaVersion);
|
||||
|
||||
Reference in New Issue
Block a user