desktopr 1.2.2 → 1.2.3
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.
|
@@ -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", {
|
|
63
|
+
core.invoke("dtr_win_close", { _label });
|
|
61
64
|
};
|
|
62
65
|
exports.closeWindow = closeWindow;
|