Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor showing default theme on first load #130

Open
benbaker76 opened this issue Mar 27, 2024 · 0 comments
Open

Editor showing default theme on first load #130

benbaker76 opened this issue Mar 27, 2024 · 0 comments

Comments

@benbaker76
Copy link

benbaker76 commented Mar 27, 2024

When you load the UserPage for the first time the editor will be themed default and the rest will be in vs-dark mode. I tried the following change:

        create: function (id, value, language) {
            if (!id) { return; }
            let _theme = "vs-dark"; // was "default"
            let userPreferences = localStorage.getItem("userPreferences");
            if (userPreferences) {
                const userPrefer
encesJSON = JSON.parse(userPreferences);
                if (userPreferencesJSON.hasOwnProperty("DarkTheme") && userPreferencesJSON.DarkTheme) {
                    _theme = "vs-dark";
                }

Which appears to fix it at first until you refresh the page when you have the theme set to default. The editor shows in vs-dark mode. The problem appears to be a failure to load the setting properly when you refresh or when there's no userPreferences set.

Screenshot from 2024-03-27 08-20-25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant