Skip to content

Commit

Permalink
fix(app): fix editor state options persistence after refresh (#474)
Browse files Browse the repository at this point in the history
* fix(app): fix editor state options persistence after refresh
* Create .changeset/short-turtles-hug.md
  • Loading branch information
riccardoperra authored Feb 26, 2023
1 parent 0795dda commit 34be9c4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/short-turtles-hug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@codeimage/app": patch
---

fix(app): fix editor state options persistence after refresh
6 changes: 3 additions & 3 deletions apps/codeimage/src/state/editor/editor.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import type * as ApiTypes from '@codeimage/api/api-types';
import {defineStore} from 'statebuilder';
import {withProxyCommands, createCommand} from 'statebuilder/commands';
import {SUPPORTED_LANGUAGES} from '@codeimage/config';
import {provideAppState} from '@codeimage/store/index';
import {createUniqueId} from '@codeimage/store/plugins/unique-id';
Expand All @@ -10,6 +8,8 @@ import {filter} from '@solid-primitives/immutable';
import {map, shareReplay} from 'rxjs';
import {createMemo, createSelector} from 'solid-js';
import {SetStoreFunction} from 'solid-js/store';
import {defineStore} from 'statebuilder';
import {createCommand, withProxyCommands} from 'statebuilder/commands';
import {EditorState, EditorUIOptions, PersistedEditorState} from './model';

const defaultId = createUniqueId();
Expand Down Expand Up @@ -91,7 +91,7 @@ export function createEditorsStore() {
code: editor.code,
}));
return {
options: {...persistedState.options, ...state.options},
options: {...state.options, ...persistedState.options},
activeEditorId: editors[0].id,
editors: editors.map(editor => {
return {
Expand Down

0 comments on commit 34be9c4

Please sign in to comment.