Skip to content

Commit

Permalink
fix: Display code line configuration synchronized to sharing service
Browse files Browse the repository at this point in the history
  • Loading branch information
1943time committed Nov 27, 2023
1 parent b81babb commit 32576c8
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/renderer/src/server/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {compareVersions} from 'compare-versions'
import {message$} from '../utils'

export class ShareStore {
readonly minVersion = '0.2.0'
readonly minVersion = '0.2.1'
remoteVersion = ''
currentVersion = ''
docMap = new Map<string, IDoc>()
Expand Down
1 change: 1 addition & 0 deletions src/renderer/src/server/sync/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ export class ShareApi {
preferences: {
codeTabSize: number
codeTheme: string
codeLineNumber: boolean
}
}) {
const time = Date.now()
Expand Down
3 changes: 2 additions & 1 deletion src/renderer/src/server/ui/ServiceSet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ export const ServiceSet = observer((props: {
secret: value.secret,
preferences: {
codeTabSize: configStore.config.codeTabSize,
codeTheme: configStore.config.codeTheme
codeTheme: configStore.config.codeTheme,
codeLineNumber: configStore.config.codeLineNumber
}
}).catch(e => {
if (e.response?.body) {
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/store/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class ConfigStore {
setConfig<T extends keyof typeof this.config>(key: T, value: typeof this.config[T]) {
this.config[key] = value
ipcRenderer.send('setStore', `config.${key}`, value)
if (key === 'codeTabSize' || key === 'codeTheme' && shareStore.serviceConfig) {
if (['codeTabSize', 'codeTheme', 'codeLineNumber'].includes(key) && shareStore.serviceConfig) {
shareStore.api.setPreferences({
[key]: value
})
Expand Down

0 comments on commit 32576c8

Please sign in to comment.