Skip to content

Commit

Permalink
fix self-update announcement check
Browse files Browse the repository at this point in the history
  • Loading branch information
LinqLover committed Nov 20, 2024
1 parent dfbef95 commit cbe850d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ self-updating
checkSelfUpdatesIfFound: dateBlock

| selfUpdateTimeStamps response selfUpdateTimeStampsUrl hasUpdates |
selfUpdateTimeStampsUrl := 'https://gist.githubusercontent.com/LinqLover/36dd3c4a155eed5aa7e874415cd60eea/raw/{1}.json' format: {('latestTimeStamps/{1}' format: {"self selfUpdateBranch"nil}) asFileName encodeForHTTP}.
selfUpdateTimeStampsUrl := 'https://gist.githubusercontent.com/LinqLover/36dd3c4a155eed5aa7e874415cd60eea/raw/{1}.json' format: {('latestTimeStamps/{1}' format: {self selfUpdateBranch}) asFileName encodeForHTTP}.
response := WebClient httpGet: selfUpdateTimeStampsUrl.
response isSuccess ifFalse: [^ false].

Expand All @@ -15,4 +15,4 @@ checkSelfUpdatesIfFound: dateBlock
ifPresent: [:selfUpdateTimeStamp | selfUpdateTimeStamp > packageInfoAndTimeStamp value]
ifAbsent: [true]].

^ "hasUpdates"true ifTrue: [dateBlock value: selfUpdateTimeStamps max asDateAndTime]
^ hasUpdates ifTrue: [dateBlock value: selfUpdateTimeStamps max asDateAndTime]
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ pendingAnnouncements
self shouldShowAnnouncements ifFalse: [^ #()].

^ Array streamContents: [:stream |
self checkSelfUpdatesIfFound: [:date | stream nextPut: (self selfUpdateAnnouncementFor: DateAndTime today - 5 days"date")].
self checkSelfUpdatesIfFound: [:date | stream nextPut: (self selfUpdateAnnouncementFor: date)].
(self allAnnouncementSelectors copyWithoutAll: (HiddenAnnouncementSelectors ifNil: [#()])) do: [:selector |
stream nextPut: (self perform: selector)]]
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"basicSelfUpdateBranch:" : "ct 11/25/2022 21:27",
"basicSelfUpdateMetacelloSpec" : "ct 8/27/2023 21:47",
"basicSelfUpdateMetacelloSpec:" : "ct 8/27/2023 21:36",
"checkSelfUpdatesIfFound:" : "ct 11/18/2024 20:30",
"checkSelfUpdatesIfFound:" : "ct 11/19/2024 18:56",
"cleanUp:" : "ct 11/18/2024 20:43",
"defaultFeedbackText" : "ct 11/18/2024 01:37",
"defaultInbox" : "ct 5/26/2021 23:41",
Expand Down Expand Up @@ -46,7 +46,7 @@
"openDefault" : "ct 5/7/2021 15:57",
"openOn:" : "ct 5/7/2021 15:58",
"openUrl:" : "ct 7/24/2021 02:27",
"pendingAnnouncements" : "ct 11/18/2024 20:48",
"pendingAnnouncements" : "ct 11/20/2024 03:10",
"registerInWorldMenu" : "ct 5/18/2021 16:29",
"repositoryUrl" : "ct 7/14/2021 15:43",
"resetAnnouncements" : "ct 11/18/2024 20:48",
Expand Down

0 comments on commit cbe850d

Please sign in to comment.