desktopr 1.2.2 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist-sdk/_constants.d.ts
CHANGED
|
@@ -3,3 +3,4 @@ export declare const APP_VERSION: string;
|
|
|
3
3
|
export declare const COMAPNION_WINDOW_LABEL_PREFIX: string;
|
|
4
4
|
export declare const READY_EVENT_NAME: string;
|
|
5
5
|
export declare const WINDOWS_LABELS_TRACKER_VARIABLE_NAME: string;
|
|
6
|
+
export declare const BROWSER_STORAGE_NAMESPACE: string;
|
package/dist-sdk/_constants.js
CHANGED
|
@@ -3,10 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.WINDOWS_LABELS_TRACKER_VARIABLE_NAME = exports.READY_EVENT_NAME = exports.COMAPNION_WINDOW_LABEL_PREFIX = exports.APP_VERSION = exports.APP_URL = void 0;
|
|
6
|
+
exports.BROWSER_STORAGE_NAMESPACE = exports.WINDOWS_LABELS_TRACKER_VARIABLE_NAME = exports.READY_EVENT_NAME = exports.COMAPNION_WINDOW_LABEL_PREFIX = exports.APP_VERSION = exports.APP_URL = void 0;
|
|
7
7
|
const bridge_constants_json_1 = __importDefault(require("./bridge.constants.json"));
|
|
8
8
|
exports.APP_URL = bridge_constants_json_1.default.appUrl;
|
|
9
9
|
exports.APP_VERSION = bridge_constants_json_1.default.appVersion;
|
|
10
10
|
exports.COMAPNION_WINDOW_LABEL_PREFIX = bridge_constants_json_1.default.companionWindowLabelPrefix;
|
|
11
11
|
exports.READY_EVENT_NAME = "dtrReady";
|
|
12
12
|
exports.WINDOWS_LABELS_TRACKER_VARIABLE_NAME = "open-windows-labels-tracker-rpkw6kjzxn8bfhj5u74q";
|
|
13
|
+
exports.BROWSER_STORAGE_NAMESPACE = "dtr_xam8wknpz1vf";
|
|
@@ -46,17 +46,20 @@ const newWindow = async (core, options) => {
|
|
|
46
46
|
};
|
|
47
47
|
exports.newWindow = newWindow;
|
|
48
48
|
const closeWindow = async (core, label) => {
|
|
49
|
+
const trimmedLabel = (label?.trim()) ?? "";
|
|
50
|
+
const _label = trimmedLabel ?? "main";
|
|
49
51
|
try {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
delete usedLabelsObj[
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
if (trimmedLabel) {
|
|
53
|
+
const usedLabelsJSON = await sdk_1.Desktopr.globalVariables.get(_constants_1.WINDOWS_LABELS_TRACKER_VARIABLE_NAME);
|
|
54
|
+
let usedLabelsObj = await JSON.parse(usedLabelsJSON);
|
|
55
|
+
delete usedLabelsObj[trimmedLabel];
|
|
56
|
+
const updatedUsedLabelsJSON = JSON.stringify(usedLabelsObj);
|
|
57
|
+
await sdk_1.Desktopr.globalVariables.set(_constants_1.WINDOWS_LABELS_TRACKER_VARIABLE_NAME, updatedUsedLabelsJSON);
|
|
58
|
+
}
|
|
56
59
|
}
|
|
57
60
|
catch (error) {
|
|
58
61
|
console.warn("Could not update used windows labels tracker");
|
|
59
62
|
}
|
|
60
|
-
core.invoke("dtr_win_close", { label });
|
|
63
|
+
core.invoke("dtr_win_close", { label: _label });
|
|
61
64
|
};
|
|
62
65
|
exports.closeWindow = closeWindow;
|