Enable currency settings and sticker pack synchronization

This commit is contained in:
Audrius Molis 2022-03-28 15:55:05 +01:00 committed by Audrius Molis
parent 4d15ae8a85
commit a244d77657
2 changed files with 5 additions and 4 deletions

View File

@ -38,9 +38,7 @@ var (
Currency = SettingField{ Currency = SettingField{
reactFieldName: "currency", reactFieldName: "currency",
dBColumnName: "currency", dBColumnName: "currency",
// TODO resolve issue 6 https://github.com/status-im/status-react/pull/13053#issuecomment-1065179963
syncProtobufFactory: &SyncProtobufFactory{ syncProtobufFactory: &SyncProtobufFactory{
inactive: true, // Remove after issue is resolved
fromInterface: currencyProtobufFactory, fromInterface: currencyProtobufFactory,
fromStruct: currencyProtobufFactoryStruct, fromStruct: currencyProtobufFactoryStruct,
valueFromProtobuf: StringFromSyncProtobuf, valueFromProtobuf: StringFromSyncProtobuf,
@ -307,9 +305,7 @@ var (
reactFieldName: "stickers/packs-installed", reactFieldName: "stickers/packs-installed",
dBColumnName: "stickers_packs_installed", dBColumnName: "stickers_packs_installed",
valueHandler: JSONBlobHandler, valueHandler: JSONBlobHandler,
// TODO resolve issue 8 https://github.com/status-im/status-react/pull/13053#issuecomment-1065179963
syncProtobufFactory: &SyncProtobufFactory{ syncProtobufFactory: &SyncProtobufFactory{
inactive: true, // Remove after issue is resolved
fromInterface: stickersPacksInstalledProtobufFactory, fromInterface: stickersPacksInstalledProtobufFactory,
fromStruct: stickersPacksInstalledProtobufFactoryStruct, fromStruct: stickersPacksInstalledProtobufFactoryStruct,
valueFromProtobuf: BytesFromSyncProtobuf, valueFromProtobuf: BytesFromSyncProtobuf,

View File

@ -2,6 +2,7 @@ package protocol
import ( import (
"context" "context"
"encoding/json"
"go.uber.org/zap" "go.uber.org/zap"
@ -89,6 +90,10 @@ func (m *Messenger) handleSyncSetting(response *MessengerResponse, syncSetting *
return err return err
} }
if v, ok := value.([]byte); ok {
value = json.RawMessage(v)
}
response.Settings = append(response.Settings, &settings.SyncSettingField{SettingField: sf, Value: value}) response.Settings = append(response.Settings, &settings.SyncSettingField{SettingField: sf, Value: value})
return nil return nil
} }