From 33cb5e255d4c110a3eb6fc38c1cabf682e71c68b Mon Sep 17 00:00:00 2001 From: Mark Haslinghuis Date: Fri, 18 Apr 2025 00:02:44 +0200 Subject: [PATCH] feat: open options-tab on first visit (#4426) * feat: open options-tab on first visit * Use appropiate storage function * Needed a delay * Remove space on EOL --- src/js/main.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/js/main.js b/src/js/main.js index fd2ca4f5..60b13eae 100644 --- a/src/js/main.js +++ b/src/js/main.js @@ -110,6 +110,19 @@ function startProcess() { // log library versions in console to make version tracking easier console.log(`Libraries: jQuery - ${$.fn.jquery}, three.js - ${THREE.REVISION}`); + // Check if this is the first visit + if (getConfig('firstRun').firstRun === undefined) { + setConfig({ firstRun: true }); + import('./tabs/static_tab.js').then(({ staticTab }) => { + staticTab.initialize('options', () => { + setTimeout(() => { + // Open the options tab after a delay + $("#tabs .tab_options a").click(); + }, 100); + }); + }); + } + // Tabs $("#tabs ul.mode-connected li").click(function () { // store the first class of the current tab (omit things like ".active")