File tree Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,9 @@ const useWorkspaceLoad = (props: ISTKProps) => {
1414 if ( props . data ) {
1515 store . dispatch ( sync ( props . data ) ) ;
1616 } else {
17- store . dispatch ( initializeElements ( ) ) ;
17+ if ( ! props . options ?. blank ) {
18+ store . dispatch ( initializeElements ( ) ) ;
19+ }
1820 }
1921 props . events ?. onWorkspaceLoad ?.( ) ;
2022 } , [ props . data ] ) ;
Original file line number Diff line number Diff line change @@ -91,6 +91,9 @@ export const slice = createSlice({
9191 resetWorkspace : ( state ) => {
9292 state . initialized = false ;
9393 state . dataSynced = false ;
94+ Object . keys ( initialState ) . forEach ( ( key ) => {
95+ state [ key ] = initialState [ key ] ;
96+ } ) ;
9497 } ,
9598 setCursor : ( state , action ) => {
9699 state . cursor = action . payload ;
Original file line number Diff line number Diff line change @@ -86,6 +86,8 @@ export interface ISTKProps {
8686 maxImageSize ?: number ;
8787 /** Overrides the default input placeholder at the top left corner of the screen */
8888 locationInputPlaceholder ?: string ;
89+ /** Loads a blank workspace */
90+ blank ?: boolean ;
8991 } ;
9092 plugins ?: IPlugins ;
9193}
You can’t perform that action at this time.
0 commit comments