Bug 1892461 Comment 3 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

I've checked this out with the Themes component, and I can confirm that this is the behaviour there as well. I suspect it never came up because within about:welcome where the themes component was used, there's no `esc` behaviour or `dismiss` button - the only way to navigate forward is to click "not now", which has `theme: automatic` included in the action to reset the theme.

There is an option in code to toggle this; setting `"persistActiveTheme": true` on the tiles action will set the initial theme, so that we can revert to it on navigation. I believe this is what was used for the upgrade spotlight when themes were included there.

```
     // If the action has persistActiveTheme: true, we set the initial theme to the currently active theme
    // so that it can be reverted to in the event that the user navigates away from the screen
    if (action.persistActiveTheme) {
      this.props.setInitialTheme(this.props.activeTheme);
    }
```
Usage like this:

```
"tiles": {
          "type": "theme",
          "action": {
            "theme": "<event>",
            "persistActiveTheme": true
          },
....
```
I've checked this out with the Themes component, and I can confirm that this is the behaviour there as well. I suspect it never came up because within about:welcome where the themes component was used, there's no `esc` behaviour or `dismiss` button - the only way to navigate forward is to click "not now", which has `theme: automatic` included in the action to reset the theme.

There is an option in code to toggle this; setting `"persistActiveTheme": true` on the tiles action will set the initial theme, so that we can revert to it on navigation. I believe this is what was used for the upgrade spotlight when themes were included there.

```
     // If the action has persistActiveTheme: true, we set the initial theme to the currently active theme
    // so that it can be reverted to in the event that the user navigates away from the screen
    if (action.persistActiveTheme) {
      this.props.setInitialTheme(this.props.activeTheme);
    }
```
Usage like this:

```
"tiles": {
          "type": "theme",
          "action": {
            "theme": "<event>",
            "persistActiveTheme": true
          },
....
```
I don't know if this can be leveraged to work for wallpapers as well; at first glance it seems like the implementation will need to be a little different since we are setting wallpapers with a theme and not enabling/disabling an addon.
I've checked this out with the Themes component, and I can confirm that this is the behaviour there as well. I suspect it never came up because within about:welcome where the themes component was used, there's no `esc` behaviour or `dismiss` button - the only way to navigate forward is to click "not now", which has `theme: automatic` included in the action to reset the theme.

There is an option in code to toggle this; setting `"persistActiveTheme": true` on the tiles action will set the initial theme, so that we can revert to it on navigation. I believe this is what was used for the upgrade spotlight when themes were included there.

```
     // If the action has persistActiveTheme: true, we set the initial theme to the currently active theme
    // so that it can be reverted to in the event that the user navigates away from the screen
    if (action.persistActiveTheme) {
      this.props.setInitialTheme(this.props.activeTheme);
    }
```
Usage like this:

```
"tiles": {
          "type": "theme",
          "action": {
            "theme": "<event>",
            "persistActiveTheme": true
          },
....
```
I don't know if this can be leveraged to work for wallpapers as well; at first glance it seems like the implementation will need to be a little different since we are setting wallpapers with a pref and not enabling/disabling an addon.

Back to Bug 1892461 Comment 3