Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AloqaIM-Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
AloqaIM-Android
Commits
6c82cf20
Unverified
Commit
6c82cf20
authored
Feb 22, 2018
by
Leonardo Aramaki
Committed by
GitHub
Feb 22, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #795 from RocketChat/fix-settings-lenient
Make SettingsAdapter lenient
parents
4c5fe904
25f854de
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
SharedPreferencesSettingsRepository.kt
...er/infraestructure/SharedPreferencesSettingsRepository.kt
+4
-4
No files found.
app/src/main/java/chat/rocket/android/server/infraestructure/SharedPreferencesSettingsRepository.kt
View file @
6c82cf20
...
@@ -6,16 +6,16 @@ import chat.rocket.android.server.domain.SettingsRepository
...
@@ -6,16 +6,16 @@ import chat.rocket.android.server.domain.SettingsRepository
import
chat.rocket.core.internal.SettingsAdapter
import
chat.rocket.core.internal.SettingsAdapter
import
chat.rocket.core.model.Value
import
chat.rocket.core.model.Value
class
SharedPreferencesSettingsRepository
(
private
val
localRe
s
pository
:
LocalRepository
)
:
SettingsRepository
{
class
SharedPreferencesSettingsRepository
(
private
val
localRepository
:
LocalRepository
)
:
SettingsRepository
{
private
val
adapter
=
SettingsAdapter
()
private
val
adapter
=
SettingsAdapter
()
.
lenient
()
override
fun
save
(
url
:
String
,
settings
:
Map
<
String
,
Value
<
Any
>>)
{
override
fun
save
(
url
:
String
,
settings
:
Map
<
String
,
Value
<
Any
>>)
{
localRe
s
pository
.
save
(
"$SETTINGS_KEY$url"
,
adapter
.
toJson
(
settings
))
localRepository
.
save
(
"$SETTINGS_KEY$url"
,
adapter
.
toJson
(
settings
))
}
}
override
fun
get
(
url
:
String
):
Map
<
String
,
Value
<
Any
>>?
{
override
fun
get
(
url
:
String
):
Map
<
String
,
Value
<
Any
>>?
{
val
settings
=
localRe
s
pository
.
get
(
"$SETTINGS_KEY$url"
)
val
settings
=
localRepository
.
get
(
"$SETTINGS_KEY$url"
)
settings
?.
let
{
settings
?.
let
{
return
adapter
.
fromJson
(
it
)
return
adapter
.
fromJson
(
it
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment