-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32272 from kubabutkiewicz/ts-migration/UnreadIndi…
…catorUpdater/lib [TS migration] Migrate 'UnreadIndicatorUpdater' lib to TypeScript
- Loading branch information
Showing
7 changed files
with
30 additions
and
20 deletions.
There are no files selected for viewing
14 changes: 8 additions & 6 deletions
14
src/libs/UnreadIndicatorUpdater/index.js → src/libs/UnreadIndicatorUpdater/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
src/libs/UnreadIndicatorUpdater/updateUnread/index.android.js
This file was deleted.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
src/libs/UnreadIndicatorUpdater/updateUnread/index.android.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import UpdateUnread from './types'; | ||
|
||
// Android does not yet implement this | ||
const updateUnread: UpdateUnread = () => {}; | ||
|
||
export default updateUnread; |
6 changes: 3 additions & 3 deletions
6
...atorUpdater/updateUnread/index.desktop.js → ...atorUpdater/updateUnread/index.desktop.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
import ELECTRON_EVENTS from '../../../../desktop/ELECTRON_EVENTS'; | ||
import UpdateUnread from './types'; | ||
|
||
/** | ||
* Set the badge on desktop | ||
* | ||
* @param {Number} totalCount | ||
*/ | ||
function updateUnread(totalCount) { | ||
const updateUnread: UpdateUnread = (totalCount) => { | ||
// Ask the main Electron process to update our | ||
// badge count in the Mac OS dock icon | ||
window.electron.send(ELECTRON_EVENTS.REQUEST_UPDATE_BADGE_COUNT, totalCount); | ||
} | ||
}; | ||
|
||
export default updateUnread; |
7 changes: 3 additions & 4 deletions
7
...ndicatorUpdater/updateUnread/index.ios.js → ...ndicatorUpdater/updateUnread/index.ios.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
import Airship from '@ua/react-native-airship'; | ||
import UpdateUnread from './types'; | ||
|
||
/** | ||
* Set the App Icon badge with the number of | ||
* unread messages on iOS | ||
* | ||
* @param {Number} totalCount | ||
*/ | ||
function updateUnread(totalCount) { | ||
const updateUnread: UpdateUnread = (totalCount) => { | ||
Airship.push.iOS.setBadgeNumber(totalCount); | ||
} | ||
}; | ||
|
||
export default updateUnread; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
type UpdateUnread = (totalCount: number) => void; | ||
|
||
export default UpdateUnread; |