Skip to content

Commit 2f65236

Browse files
committed
Fixed Get Current theme issue when customized using dashboard (#47)
1 parent 4e9a509 commit 2f65236

4 files changed

Lines changed: 7 additions & 5 deletions

File tree

api/deployment.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ func GetPage() (*HostedPageResponse, error) {
9696
if err != nil {
9797
return nil, err
9898
}
99+
// This Logic is needed to support the theme customization done using Dashboard.
100+
resultResp.Pages[0].Status = strings.ReplaceAll(resultResp.Pages[0].Status, "9", "")
99101
return &resultResp, nil
100102
}
101103

cli_home.png

75.4 KB
Loading

cmd/get/theme/theme.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ func NewThemeCmd() *cobra.Command {
2222
Example: heredoc.Doc(`
2323
$ lr get theme --all
2424
Available Themes:
25-
1. Tokyo
26-
2. London
25+
1. London
26+
2. Tokyo
2727
3. Helsinki
2828
2929
$ lr get theme --active
@@ -43,16 +43,15 @@ func NewThemeCmd() *cobra.Command {
4343
func themes() error {
4444
if *all && !*active {
4545
fmt.Println("Available Themes:")
46-
fmt.Println("1. Tokyo")
47-
fmt.Println("2. London")
46+
fmt.Println("1. London")
47+
fmt.Println("2. Tokyo")
4848
fmt.Println("3. Helsinki")
4949
} else if *active && !*all {
5050
resp, err := api.GetPage()
5151
if err != nil {
5252
return err
5353
}
5454
index := resp.Pages[0].Status
55-
5655
fmt.Println("Current Theme:", cmdutil.ThemeMap[index])
5756
} else {
5857
fmt.Println("Use exactly one of the following flags: ")

cmdutil/constant.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package cmdutil
22

33
var ThemeMap = map[string]string{
4+
"0": "London", // Handled fallback logic to London.
45
"1": "London",
56
"2": "Tokyo",
67
"3": "Helsinki",

0 commit comments

Comments
 (0)