mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-20 22:14:06 +01:00
🎨 The reminder message will no longer pop up when the subscription expires for more than 2 days Fix https://github.com/siyuan-note/siyuan/issues/7816
This commit is contained in:
parent
cdb662f2bf
commit
574b7f39c9
6 changed files with 14 additions and 11 deletions
|
|
@ -227,12 +227,15 @@ func refreshSubscriptionExpirationRemind() {
|
|||
}
|
||||
if IsSubscriber() && -1 != Conf.User.UserSiYuanProExpireTime {
|
||||
expired := int64(Conf.User.UserSiYuanProExpireTime)
|
||||
if time.Now().UnixMilli() >= expired { // 已经过期
|
||||
time.Sleep(time.Second * 30)
|
||||
util.PushErrMsg(Conf.Language(128), 0)
|
||||
now := time.Now().UnixMilli()
|
||||
if now >= expired { // 已经过期
|
||||
if now-expired <= 1000*60*60*24*2 { // 2 天内提醒 https://github.com/siyuan-note/siyuan/issues/7816
|
||||
time.Sleep(time.Second * 30)
|
||||
util.PushErrMsg(Conf.Language(128), 0)
|
||||
}
|
||||
return
|
||||
}
|
||||
remains := int((expired - time.Now().UnixMilli()) / 1000 / 60 / 60 / 24)
|
||||
remains := int((expired - now) / 1000 / 60 / 60 / 24)
|
||||
expireDay := 15 // 付费订阅提前 15 天提醒
|
||||
if 2 == Conf.User.UserSiYuanSubscriptionPlan {
|
||||
expireDay = 3 // 试用订阅提前 3 天提醒
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue