@forgeax/interface 0.9.1 → 0.9.2
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.
|
@@ -61,14 +61,12 @@ export async function bootstrapAppHost(overrides = {}) {
|
|
|
61
61
|
...m,
|
|
62
62
|
async setup(ctx) {
|
|
63
63
|
control.beginSetup(m);
|
|
64
|
-
const
|
|
64
|
+
const cleanups = [];
|
|
65
|
+
let pageCleanup;
|
|
65
66
|
try {
|
|
66
|
-
const cleanups = [];
|
|
67
|
-
let pageCleanup;
|
|
68
67
|
for (const menu of m.contributes?.menus ?? []) {
|
|
69
|
-
|
|
68
|
+
cleanups.push(host.menus.register(menu));
|
|
70
69
|
}
|
|
71
|
-
cleanups.push(...menuCleanups);
|
|
72
70
|
if (m.contributes?.panels) {
|
|
73
71
|
cleanups.push(control.contributePanels(m.id, m.contributes.panels));
|
|
74
72
|
}
|
|
@@ -100,7 +98,10 @@ export async function bootstrapAppHost(overrides = {}) {
|
|
|
100
98
|
};
|
|
101
99
|
}
|
|
102
100
|
catch (error) {
|
|
103
|
-
|
|
101
|
+
// Preserve the same page-close decision boundary on failed setup.
|
|
102
|
+
// A dirty page must not lose its surrounding contributions underneath it.
|
|
103
|
+
await pageCleanup?.();
|
|
104
|
+
for (const cleanup of cleanups.slice().reverse())
|
|
104
105
|
await cleanup();
|
|
105
106
|
throw error;
|
|
106
107
|
}
|
|
@@ -61,14 +61,12 @@ export async function bootstrapAppHost(overrides = {}) {
|
|
|
61
61
|
...m,
|
|
62
62
|
async setup(ctx) {
|
|
63
63
|
control.beginSetup(m);
|
|
64
|
-
const
|
|
64
|
+
const cleanups = [];
|
|
65
|
+
let pageCleanup;
|
|
65
66
|
try {
|
|
66
|
-
const cleanups = [];
|
|
67
|
-
let pageCleanup;
|
|
68
67
|
for (const menu of m.contributes?.menus ?? []) {
|
|
69
|
-
|
|
68
|
+
cleanups.push(host.menus.register(menu));
|
|
70
69
|
}
|
|
71
|
-
cleanups.push(...menuCleanups);
|
|
72
70
|
if (m.contributes?.panels) {
|
|
73
71
|
cleanups.push(control.contributePanels(m.id, m.contributes.panels));
|
|
74
72
|
}
|
|
@@ -100,7 +98,10 @@ export async function bootstrapAppHost(overrides = {}) {
|
|
|
100
98
|
};
|
|
101
99
|
}
|
|
102
100
|
catch (error) {
|
|
103
|
-
|
|
101
|
+
// Preserve the same page-close decision boundary on failed setup.
|
|
102
|
+
// A dirty page must not lose its surrounding contributions underneath it.
|
|
103
|
+
await pageCleanup?.();
|
|
104
|
+
for (const cleanup of cleanups.slice().reverse())
|
|
104
105
|
await cleanup();
|
|
105
106
|
throw error;
|
|
106
107
|
}
|