Spaces:
Running
Running
GitHub Actions commited on
Commit ·
d43ec0c
1
Parent(s): 6f53325
sync from abhijitramesh/webgpu-bench@5fbc77a4b0
Browse files- js/run/controller.js +13 -2
js/run/controller.js
CHANGED
|
@@ -935,7 +935,10 @@ async function onRunClick() {
|
|
| 935 |
clearRunIntent();
|
| 936 |
|
| 937 |
try {
|
| 938 |
-
|
|
|
|
|
|
|
|
|
|
| 939 |
} catch { /* quota */ }
|
| 940 |
|
| 941 |
if (state.surface === 'localhost' && $('save-local')?.checked) {
|
|
@@ -1625,9 +1628,17 @@ export async function mountRunSection() {
|
|
| 1625 |
const RESULTS_STORAGE_KEY = 'webgpu-bench:lastRun';
|
| 1626 |
|
| 1627 |
function restoreSavedResults() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1628 |
let saved;
|
| 1629 |
try {
|
| 1630 |
-
|
|
|
|
|
|
|
|
|
|
| 1631 |
if (!raw) return;
|
| 1632 |
saved = JSON.parse(raw);
|
| 1633 |
} catch { return; }
|
|
|
|
| 935 |
clearRunIntent();
|
| 936 |
|
| 937 |
try {
|
| 938 |
+
// sessionStorage so results survive in-tab navigations (the OAuth
|
| 939 |
+
// sign-in redirect in particular) but reset when the user actually
|
| 940 |
+
// closes the tab — they don't want stale results on a fresh visit.
|
| 941 |
+
sessionStorage.setItem(RESULTS_STORAGE_KEY, JSON.stringify(state.results));
|
| 942 |
} catch { /* quota */ }
|
| 943 |
|
| 944 |
if (state.surface === 'localhost' && $('save-local')?.checked) {
|
|
|
|
| 1628 |
const RESULTS_STORAGE_KEY = 'webgpu-bench:lastRun';
|
| 1629 |
|
| 1630 |
function restoreSavedResults() {
|
| 1631 |
+
// Clean up the pre-migration localStorage entry — earlier builds wrote
|
| 1632 |
+
// results there, which made them persist across full tab closes. The
|
| 1633 |
+
// canonical location is now sessionStorage.
|
| 1634 |
+
try { localStorage.removeItem(RESULTS_STORAGE_KEY); } catch { /* noop */ }
|
| 1635 |
+
|
| 1636 |
let saved;
|
| 1637 |
try {
|
| 1638 |
+
// sessionStorage matches the per-variant write path: results live for
|
| 1639 |
+
// the tab session (so the OAuth redirect round-trip is covered) and
|
| 1640 |
+
// are gone after the user closes the tab.
|
| 1641 |
+
const raw = sessionStorage.getItem(RESULTS_STORAGE_KEY);
|
| 1642 |
if (!raw) return;
|
| 1643 |
saved = JSON.parse(raw);
|
| 1644 |
} catch { return; }
|