Skip to content

Commit 5c01b57

Browse files
committed
Retain state only on tutorial page
1 parent e2cb596 commit 5c01b57

1 file changed

Lines changed: 13 additions & 12 deletions

File tree

src/service/webviewService.ts

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,17 @@ export class WebviewService {
4242
</script>
4343
<script ></script>
4444
${this.loadScript(
45-
this.context,
46-
webviewType,
47-
"out/vendor.js",
48-
hasDevice
49-
)}
45+
this.context,
46+
webviewType,
47+
"out/vendor.js",
48+
hasDevice
49+
)}
5050
${this.loadScript(
51-
this.context,
52-
webviewType,
53-
"out/simulator.js",
54-
hasDevice
55-
)}
51+
this.context,
52+
webviewType,
53+
"out/simulator.js",
54+
hasDevice
55+
)}
5656
</body>
5757
</html>`;
5858
}
@@ -64,6 +64,7 @@ export class WebviewService {
6464
{ preserveFocus: true, viewColumn: vscode.ViewColumn.One },
6565
{
6666
enableScripts: true,
67+
retainContextWhenHidden: true
6768
}
6869
);
6970
this.tutorialPanel.webview.html = this.getWebviewContent(
@@ -89,9 +90,9 @@ export class WebviewService {
8990
if (hasDevice) {
9091
attributeString = `${
9192
WEBVIEW_ATTRIBUTES_KEY.TYPE
92-
}=${attributeValue} ${
93+
}=${attributeValue} ${
9394
WEBVIEW_ATTRIBUTES_KEY.INITIAL_DEVICE
94-
}=${this.deviceSelectionService.getCurrentActiveDevice()}`;
95+
}=${this.deviceSelectionService.getCurrentActiveDevice()}`;
9596
} else {
9697
attributeString = `${WEBVIEW_ATTRIBUTES_KEY.TYPE}=${attributeValue} `;
9798
}

0 commit comments

Comments
 (0)