Skip to content

Conflict theme key in local storage when Argo CD runs subpath mode. #547

@atuk721

Description

@atuk721

When Argo CD runs subpath mode and share origin with multiple applications and uses same local storage key, it became not to work.

As my experience, external application uses theme key in local storage and save "DARK" or "LIGHT" to it.
After that, when I access to Argo CD, it outputs a following error in a browser.

VM172:1 Uncaught SyntaxError: Unexpected token 'D', "DARK" is not valid JSON
    at JSON.parse (<anonymous>)
    at 10180 (main.9ecae91d8fd1deedf944.js:2:1501193)
    at i (main.9ecae91d8fd1deedf944.js:2:2463187)
    at 58535 (main.9ecae91d8fd1deedf944.js:2:2104618)
    at i (main.9ecae91d8fd1deedf944.js:2:2463187)
    at main.9ecae91d8fd1deedf944.js:2:2468811
    at main.9ecae91d8fd1deedf944.js:2:2468821
10180 @ main.9ecae91d8fd1deedf944.js:2
i @ main.9ecae91d8fd1deedf944.js:2
58535 @ main.9ecae91d8fd1deedf944.js:2
i @ main.9ecae91d8fd1deedf944.js:2
(anonymous) @ main.9ecae91d8fd1deedf944.js:2
(anonymous) @ main.9ecae91d8fd1deedf944.js:2

I think it occurs below because theme item is not JSON.

https://github.com/argoproj/argo-ui/blob/master/v2/shared/context/theme.tsx#L10

So I think this should change key name more specific like "argo-ui-theme" because Argo CD can run by subpath mode.
Or should add error handlings to it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions