File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -89,6 +89,7 @@ export class Tab extends StatefulClass {
8989 } ;
9090 }
9191 deserialize ( de : SerializedTab ) {
92+ if ( id >= de . id ) id = de . id + 1 ;
9293 this . id = de . id ;
9394 this . title = de . title ;
9495 this . history . deserialize ( de . history ) ;
Original file line number Diff line number Diff line change @@ -93,10 +93,14 @@ export class Browser extends StatefulClass {
9393 build ( ) : HTMLElement {
9494 let shell = < Shell tabs = { use ( this . tabs ) } activetab = { use ( this . activetab ) } /> ;
9595
96- if ( ! this . activetab ) {
96+ let de = localStorage [ "browserstate" ] ;
97+ if ( de ) {
98+ browser . deserialize ( JSON . parse ( de ) ) ;
99+ } else {
97100 let tab = this . newTab ( ) ;
98101 this . activetab = tab ;
99102 }
103+
100104 if ( this . built ) throw new Error ( "already built" ) ;
101105 this . built = true ;
102106
@@ -141,10 +145,6 @@ export class Browser extends StatefulClass {
141145export function createBrowser ( ) : Browser {
142146 let browser = new Browser ( createState ( { } ) ) ;
143147 Object . setPrototypeOf ( browser , Browser . prototype ) ;
144- let de = localStorage [ "browserstate" ] ;
145- if ( de ) {
146- browser . deserialize ( JSON . parse ( de ) ) ;
147- }
148148
149149 return browser ;
150150}
You can’t perform that action at this time.
0 commit comments