This repository was archived by the owner on Sep 11, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +36
-1
lines changed Expand file tree Collapse file tree 2 files changed +36
-1
lines changed Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ export default class RoomDeviceSettingsHandler extends AbstractLocalStorageSetti
69
69
}
70
70
71
71
private read ( key : string ) : any {
72
- return this . getItem ( key ) ;
72
+ return this . getObject ( key ) ;
73
73
}
74
74
75
75
private getKey ( settingName : string , roomId : string ) : string {
Original file line number Diff line number Diff line change
1
+ /*
2
+ Copyright 2022 The Matrix.org Foundation C.I.C.
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */
16
+
17
+ import RoomDeviceSettingsHandler from "../../../src/settings/handlers/RoomDeviceSettingsHandler" ;
18
+ import { WatchManager } from "../../../src/settings/WatchManager" ;
19
+
20
+ describe ( "RoomDeviceSettingsHandler" , ( ) => {
21
+ it ( "should correctly read cached values" , ( ) => {
22
+ const watchers = new WatchManager ( ) ;
23
+ const handler = new RoomDeviceSettingsHandler ( watchers ) ;
24
+
25
+ const settingName = "RightPanel.phases" ;
26
+ const roomId = "!room:server" ;
27
+ const value = {
28
+ isOpen : true ,
29
+ history : [ { } ] ,
30
+ } ;
31
+
32
+ handler . setValue ( settingName , roomId , value ) ;
33
+ expect ( handler . getValue ( settingName , roomId ) ) . toEqual ( value ) ;
34
+ } ) ;
35
+ } ) ;
You can’t perform that action at this time.
0 commit comments