mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-18 23:50:13 +01:00
🎨 Cloud region scoped announcement
This commit is contained in:
parent
4140d76ae6
commit
d4845eaa83
2 changed files with 11 additions and 7 deletions
|
|
@ -302,9 +302,11 @@ func refreshAnnouncement() {
|
||||||
}
|
}
|
||||||
if !exist {
|
if !exist {
|
||||||
existingAnnouncements = append(existingAnnouncements, announcement)
|
existingAnnouncements = append(existingAnnouncements, announcement)
|
||||||
|
if Conf.CloudRegion == announcement.Region {
|
||||||
newAnnouncements = append(newAnnouncements, announcement)
|
newAnnouncements = append(newAnnouncements, announcement)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
data, err := gulu.JSON.MarshalJSON(existingAnnouncements)
|
data, err := gulu.JSON.MarshalJSON(existingAnnouncements)
|
||||||
if nil != err {
|
if nil != err {
|
||||||
|
|
|
||||||
|
|
@ -214,6 +214,7 @@ type Announcement struct {
|
||||||
Id string `json:"id"`
|
Id string `json:"id"`
|
||||||
Title string `json:"title"`
|
Title string `json:"title"`
|
||||||
URL string `json:"url"`
|
URL string `json:"url"`
|
||||||
|
Region int `json:"region"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetAnnouncements() (ret []*Announcement) {
|
func GetAnnouncements() (ret []*Announcement) {
|
||||||
|
|
@ -234,6 +235,7 @@ func GetAnnouncements() (ret []*Announcement) {
|
||||||
Id: ann["id"].(string),
|
Id: ann["id"].(string),
|
||||||
Title: ann["title"].(string),
|
Title: ann["title"].(string),
|
||||||
URL: ann["url"].(string),
|
URL: ann["url"].(string),
|
||||||
|
Region: int(ann["region"].(float64)),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue