fix: rss link (#1534)

pull/1535/head
boojack 2 years ago committed by GitHub
parent 2c328a4540
commit 7d6934d00c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -113,6 +113,13 @@ func generateRSSFromMemoList(memoList []*api.Memo, baseURL string, profile *api.
} }
func getSystemCustomizedProfile(ctx context.Context, s *Server) (*api.CustomizedProfile, error) { func getSystemCustomizedProfile(ctx context.Context, s *Server) (*api.CustomizedProfile, error) {
systemSetting, err := s.Store.FindSystemSetting(ctx, &api.SystemSettingFind{
Name: api.SystemSettingCustomizedProfileName,
})
if err != nil && common.ErrorCode(err) != common.NotFound {
return nil, err
}
customizedProfile := &api.CustomizedProfile{ customizedProfile := &api.CustomizedProfile{
Name: "memos", Name: "memos",
LogoURL: "", LogoURL: "",
@ -121,15 +128,11 @@ func getSystemCustomizedProfile(ctx context.Context, s *Server) (*api.Customized
Appearance: "system", Appearance: "system",
ExternalURL: "", ExternalURL: "",
} }
systemSetting, err := s.Store.FindSystemSetting(ctx, &api.SystemSettingFind{ if systemSetting != nil {
Name: api.SystemSettingCustomizedProfileName,
})
if err != nil && common.ErrorCode(err) != common.NotFound {
return nil, err
}
if err := json.Unmarshal([]byte(systemSetting.Value), customizedProfile); err != nil { if err := json.Unmarshal([]byte(systemSetting.Value), customizedProfile); err != nil {
return nil, err return nil, err
} }
}
return customizedProfile, nil return customizedProfile, nil
} }

Loading…
Cancel
Save