-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Update to typescript 3.6.3 #19190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update to typescript 3.6.3 #19190
Changes from all commits
e9cd889
1cdaa18
ea9c8c3
a8f9c55
9c073ee
3f5616e
f845eb6
f1f648d
147eda0
7b1b5d4
21d167e
55121d5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -115,18 +115,16 @@ function* inboxRefresh( | |
| ) | ||
| } | ||
|
|
||
| yield* Saga.callRPCs( | ||
| RPCChatTypes.localGetInboxNonblockLocalRpcSaga({ | ||
| incomingCallMap: {'chat.1.chatUi.chatInboxUnverified': onUnverified}, | ||
| params: { | ||
| identifyBehavior: RPCTypes.TLFIdentifyBehavior.chatGui, | ||
| maxUnbox: 0, | ||
| query: Constants.makeInboxQuery([]), | ||
| skipUnverified: false, | ||
| }, | ||
| waitingKey: Constants.waitingKeyInboxRefresh, | ||
| }) | ||
| ) | ||
| yield RPCChatTypes.localGetInboxNonblockLocalRpcSaga({ | ||
| incomingCallMap: {'chat.1.chatUi.chatInboxUnverified': onUnverified}, | ||
| params: { | ||
| identifyBehavior: RPCTypes.TLFIdentifyBehavior.chatGui, | ||
| maxUnbox: 0, | ||
| query: Constants.makeInboxQuery([]), | ||
| skipUnverified: false, | ||
| }, | ||
| waitingKey: Constants.waitingKeyInboxRefresh, | ||
| }) | ||
| } | ||
|
|
||
| // When we get info on a team we need to unbox immediately so we can get the channel names | ||
|
|
@@ -2152,7 +2150,7 @@ function* attachmentDownload( | |
| } | ||
|
|
||
| // Download it | ||
| const destPath = yield* Saga.callPromise(downloadFilePath, message.fileName) | ||
| const destPath = yield downloadFilePath(message.fileName) | ||
| yield Saga.callUntyped(downloadAttachment, destPath, message) | ||
| } | ||
|
|
||
|
|
@@ -2516,7 +2514,7 @@ function* mobileMessageAttachmentShare( | |
| } | ||
| const fileName = yield* downloadAttachment('', message) | ||
| try { | ||
| yield* Saga.callPromise(showShareActionSheetFromFile, fileName, message.fileType) | ||
| yield showShareActionSheetFromFile(fileName) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. note: TS caught the extra param here now |
||
| } catch (e) { | ||
| logger.error('Failed to share attachment: ' + JSON.stringify(e)) | ||
| } | ||
|
|
@@ -2546,7 +2544,7 @@ function* mobileMessageAttachmentSave( | |
| ) | ||
| try { | ||
| logger.info('Trying to save chat attachment to camera roll') | ||
| yield* Saga.callPromise(saveAttachmentToCameraRoll, fileName, message.fileType) | ||
| yield saveAttachmentToCameraRoll(fileName, message.fileType) | ||
| } catch (err) { | ||
| logger.error('Failed to save attachment: ' + err) | ||
| throw new Error('Failed to save attachment: ' + err) | ||
|
|
@@ -3394,15 +3392,15 @@ const createConversationFromTeamBuilder = ( | |
| }), | ||
| ] | ||
|
|
||
| export function* chatTeamBuildingSaga(): Saga.SagaGenerator<any, any> { | ||
| export function* chatTeamBuildingSaga() { | ||
| yield* commonTeamBuildingSaga('chat2') | ||
| yield* Saga.chainAction2( | ||
| TeamBuildingGen.finishedTeamBuilding, | ||
| filterForNs('chat2', createConversationFromTeamBuilder) | ||
| ) | ||
| } | ||
|
|
||
| function* chat2Saga(): Saga.SagaGenerator<any, any> { | ||
| function* chat2Saga() { | ||
| // Platform specific actions | ||
| if (isMobile) { | ||
| // Push us into the conversation | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -400,7 +400,7 @@ function* download( | |
| case Types.DownloadIntent.None: | ||
| // This adds " (1)" suffix to the base name, if the destination path | ||
| // already exists. | ||
| localPath = yield* Saga.callPromise(Constants.downloadFilePathFromPath, path) | ||
| localPath = yield Constants.downloadFilePathFromPath(path) | ||
| break | ||
| case Types.DownloadIntent.CameraRoll: | ||
| case Types.DownloadIntent.Share: | ||
|
|
@@ -411,7 +411,7 @@ function* download( | |
| break | ||
| default: | ||
| Flow.ifFlowComplainsAboutThisFunctionYouHaventHandledAllCasesInASwitch(intent) | ||
| localPath = yield* Saga.callPromise(Constants.downloadFilePathFromPath, path) | ||
| localPath = yield Constants.downloadFilePathFromPath(path) | ||
| break | ||
| } | ||
|
|
||
|
|
@@ -709,7 +709,7 @@ function* loadPathMetadata(_: TypedState, action: FsGen.LoadPathMetadataPayload) | |
| let pathItem = makeEntry(dirent) | ||
| if (pathItem.type === Types.PathType.File) { | ||
| const mimeType = yield* _loadMimeType(path) | ||
| pathItem = pathItem.set('mimeType', mimeType) | ||
| pathItem = pathItem.set('mimeType', mimeType || null) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. correctly infers this can be undefined, which pathItem doesn't want |
||
| } | ||
| yield Saga.put( | ||
| FsGen.createPathItemLoaded({ | ||
|
|
@@ -1008,7 +1008,7 @@ const loadPathInfo = async (_: TypedState, action: FsGen.LoadPathInfoPayload) => | |
| }) | ||
| } | ||
|
|
||
| function* fsSaga(): Saga.SagaGenerator<any, any> { | ||
| function* fsSaga() { | ||
| yield* Saga.chainAction2(FsGen.refreshLocalHTTPServerInfo, refreshLocalHTTPServerInfo) | ||
| yield* Saga.chainAction2(FsGen.cancelDownload, cancelDownload) | ||
| yield* Saga.chainGenerator<FsGen.DownloadPayload | FsGen.ShareNativePayload | FsGen.SaveMediaPayload>( | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| import * as Saga from '../../util/saga' | ||
| import * as Types from '../../constants/types/fs' | ||
|
|
||
| declare function platformSpecificSaga(): Saga.SagaGenerator<any, any> | ||
| declare function platformSpecificSaga(): void | ||
|
|
||
| export default platformSpecificSaga |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,7 +44,13 @@ const getPeopleData = async (state: Container.TypedState, action: PeopleGen.GetP | |
| .reduce(Constants.reduceRPCItemToPeopleItem, I.List()) | ||
|
|
||
| if (debugTodo) { | ||
| const allTodos: Array<RPCTypes.HomeScreenTodoType> = Object.values(RPCTypes.HomeScreenTodoType) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. values is actually a mix of the numbers and the strings, so we need to be more explicit |
||
| const allTodos = Object.values(RPCTypes.HomeScreenTodoType).reduce<Array<RPCTypes.HomeScreenTodoType>>( | ||
| (arr, t) => { | ||
| typeof t !== 'string' && arr.push(t) | ||
| return arr | ||
| }, | ||
| [] | ||
| ) | ||
| allTodos.forEach(avdlType => { | ||
| const todoType = Constants.todoTypeEnumToType[avdlType] | ||
| if (newItems.some(t => t.type === 'todo' && t.todoType === todoType)) { | ||
|
|
@@ -157,7 +163,7 @@ const connected = async () => { | |
| } | ||
| } | ||
|
|
||
| const peopleSaga = function*(): Saga.SagaGenerator<any, any> { | ||
| const peopleSaga = function*() { | ||
| yield* Saga.chainAction2(PeopleGen.getPeopleData, getPeopleData) | ||
| yield* Saga.chainAction2(PeopleGen.markViewed, markViewed) | ||
| yield* Saga.chainAction2(PeopleGen.skipTodo, skipTodo) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i simplified / removed some utils from Saga. This was to help us with a flow issue but isn't necessary