Skip to content

Commit

Permalink
migrate theme color
Browse files Browse the repository at this point in the history
  • Loading branch information
juzeon committed Mar 4, 2024
1 parent 0a3a0a3 commit a281c09
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 6 additions & 1 deletion config.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ type Config struct {
}
type Migration struct {
SydneyPreset20240304 bool `json:"sydney_preset_20240304"`
ThemeColor20240304 bool `json:"theme_color_20240304"`
}

func fillDefault[T comparable](pointer *T, defaultValue T) {
Expand Down Expand Up @@ -109,6 +110,10 @@ func (o *Config) DoMigration() {
}
o.Migration.SydneyPreset20240304 = true
}
if !o.Migration.ThemeColor20240304 {
o.ThemeColor = "#00B8FF"
o.Migration.ThemeColor20240304 = true
}
}
func (o *Config) FillDefault() {
if len(o.Presets) == 0 {
Expand Down Expand Up @@ -150,7 +155,7 @@ func (o *Config) FillDefault() {
}
fillDefault(&o.WssDomain, "sydney.bing.com")
fillDefault(&o.CreateConversationURL, "https://edgeservices.bing.com/edgesvc/turing/conversation/create")
fillDefault(&o.ThemeColor, "#FF9800")
fillDefault(&o.ThemeColor, "#00B8FF")
}

type Settings struct {
Expand Down
2 changes: 2 additions & 0 deletions frontend/wailsjs/go/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export namespace main {
}
export class Migration {
sydney_preset_20240304: boolean;
theme_color_20240304: boolean;

static createFrom(source: any = {}) {
return new Migration(source);
Expand All @@ -84,6 +85,7 @@ export namespace main {
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.sydney_preset_20240304 = source["sydney_preset_20240304"];
this.theme_color_20240304 = source["theme_color_20240304"];
}
}
export class OpenAIBackend {
Expand Down

0 comments on commit a281c09

Please sign in to comment.