@@ -26,7 +26,7 @@ public async Task SetItemAsync(string key, object data)
2626 if ( e . Cancel )
2727 return ;
2828
29- await _jSRuntime . InvokeAsync < object > ( "blazoredSessionStorage .setItem" , key , JsonSerializer . Serialize ( data ) ) ;
29+ await _jSRuntime . InvokeAsync < object > ( "sessionStorage .setItem" , key , JsonSerializer . Serialize ( data ) ) ;
3030
3131 RaiseOnChanged ( key , e . OldValue , data ) ;
3232 }
@@ -36,7 +36,7 @@ public async Task<T> GetItemAsync<T>(string key)
3636 if ( string . IsNullOrEmpty ( key ) )
3737 throw new ArgumentNullException ( nameof ( key ) ) ;
3838
39- var serialisedData = await _jSRuntime . InvokeAsync < string > ( "blazoredSessionStorage .getItem" , key ) ;
39+ var serialisedData = await _jSRuntime . InvokeAsync < string > ( "sessionStorage .getItem" , key ) ;
4040
4141 if ( serialisedData == null )
4242 return default ( T ) ;
@@ -49,14 +49,14 @@ public async Task RemoveItemAsync(string key)
4949 if ( string . IsNullOrEmpty ( key ) )
5050 throw new ArgumentNullException ( nameof ( key ) ) ;
5151
52- await _jSRuntime . InvokeAsync < object > ( "blazoredSessionStorage .removeItem" , key ) ;
52+ await _jSRuntime . InvokeAsync < object > ( "sessionStorage .removeItem" , key ) ;
5353 }
5454
55- public async Task ClearAsync ( ) => await _jSRuntime . InvokeAsync < object > ( "blazoredSessionStorage .clear" ) ;
55+ public async Task ClearAsync ( ) => await _jSRuntime . InvokeAsync < object > ( "sessionStorage .clear" ) ;
5656
57- public async Task < int > LengthAsync ( ) => await _jSRuntime . InvokeAsync < int > ( "blazoredSessionStorage .length" ) ;
57+ public async Task < int > LengthAsync ( ) => await _jSRuntime . InvokeAsync < int > ( "eval" , "sessionStorage .length") ;
5858
59- public async Task < string > KeyAsync ( int index ) => await _jSRuntime . InvokeAsync < string > ( "blazoredSessionStorage .key" , index ) ;
59+ public async Task < string > KeyAsync ( int index ) => await _jSRuntime . InvokeAsync < string > ( "sessionStorage .key" , index ) ;
6060
6161 public void SetItem ( string key , object data )
6262 {
@@ -71,7 +71,7 @@ public void SetItem(string key, object data)
7171 if ( e . Cancel )
7272 return ;
7373
74- _jSInProcessRuntime . Invoke < object > ( "blazoredSessionStorage .setItem" , key , JsonSerializer . Serialize ( data ) ) ;
74+ _jSInProcessRuntime . Invoke < object > ( "sessionStorage .setItem" , key , JsonSerializer . Serialize ( data ) ) ;
7575
7676 RaiseOnChanged ( key , e . OldValue , data ) ;
7777 }
@@ -84,7 +84,7 @@ public T GetItem<T>(string key)
8484 if ( _jSInProcessRuntime == null )
8585 throw new InvalidOperationException ( "IJSInProcessRuntime not available" ) ;
8686
87- var serialisedData = _jSInProcessRuntime . Invoke < string > ( "blazoredSessionStorage .getItem" , key ) ;
87+ var serialisedData = _jSInProcessRuntime . Invoke < string > ( "sessionStorage .getItem" , key ) ;
8888
8989 if ( serialisedData == null )
9090 return default ( T ) ;
@@ -100,31 +100,31 @@ public void RemoveItem(string key)
100100 if ( _jSInProcessRuntime == null )
101101 throw new InvalidOperationException ( "IJSInProcessRuntime not available" ) ;
102102
103- _jSInProcessRuntime . Invoke < object > ( "blazoredSessionStorage .removeItem" , key ) ;
103+ _jSInProcessRuntime . Invoke < object > ( "sessionStorage .removeItem" , key ) ;
104104 }
105105
106106 public void Clear ( )
107107 {
108108 if ( _jSInProcessRuntime == null )
109109 throw new InvalidOperationException ( "IJSInProcessRuntime not available" ) ;
110110
111- _jSInProcessRuntime . Invoke < object > ( "blazoredSessionStorage .clear" ) ;
111+ _jSInProcessRuntime . Invoke < object > ( "sessionStorage .clear" ) ;
112112 }
113113
114114 public int Length ( )
115115 {
116116 if ( _jSInProcessRuntime == null )
117117 throw new InvalidOperationException ( "IJSInProcessRuntime not available" ) ;
118118
119- return _jSInProcessRuntime . Invoke < int > ( "blazoredSessionStorage .length" ) ;
119+ return _jSInProcessRuntime . Invoke < int > ( "eval" , "sessionStorage .length") ;
120120 }
121121
122122 public string Key ( int index )
123123 {
124124 if ( _jSInProcessRuntime == null )
125125 throw new InvalidOperationException ( "IJSInProcessRuntime not available" ) ;
126126
127- return _jSInProcessRuntime . Invoke < string > ( "blazoredSessionStorage .key" , index ) ;
127+ return _jSInProcessRuntime . Invoke < string > ( "sessionStorage .key" , index ) ;
128128 }
129129
130130 public event EventHandler < ChangingEventArgs > Changing ;
0 commit comments