Skip to content

Commit

Permalink
TS 3.7 + Prettier 1.19.1 (keybase#20878)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisnojima authored Nov 12, 2019
1 parent 6eafd7e commit e2777c6
Show file tree
Hide file tree
Showing 142 changed files with 669 additions and 767 deletions.
54 changes: 18 additions & 36 deletions shared/actions/chat2/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,7 @@ const maybeChangeSelectedConv = (
}
} else {
logger.info(
`maybeChangeSelectedConv: selected conv mismatch on reselect (ignoring): selected: ${
state.chat2.selectedConversation
} srvold: ${state.chat2.inboxLayout.reselectInfo.oldConvID}`
`maybeChangeSelectedConv: selected conv mismatch on reselect (ignoring): selected: ${state.chat2.selectedConversation} srvold: ${state.chat2.inboxLayout.reselectInfo.oldConvID}`
)
return false
}
Expand Down Expand Up @@ -844,9 +842,7 @@ const onChatThreadStale = (
// load the inbox instead
if (key === 'convupdate') {
logger.info(
`onChatThreadStale: dispatching inbox unbox actions for ${
conversationIDKeys.length
} convs of type ${key}`
`onChatThreadStale: dispatching inbox unbox actions for ${conversationIDKeys.length} convs of type ${key}`
)
actions = actions.concat([
Chat2Gen.createMetaRequestTrusted({
Expand All @@ -857,9 +853,7 @@ const onChatThreadStale = (
])
} else if (conversationIDKeys.length > 0) {
logger.info(
`onChatThreadStale: dispatching thread reload actions for ${
conversationIDKeys.length
} convs of type ${key}`
`onChatThreadStale: dispatching thread reload actions for ${conversationIDKeys.length} convs of type ${key}`
)
actions = actions.concat([
Chat2Gen.createMarkConversationsStale({
Expand Down Expand Up @@ -2077,15 +2071,15 @@ function* attachmentFullscreenNext(state: TypedState, action: Chat2Gen.Attachmen
const currentSelection = state.chat2.attachmentFullscreenSelection
const currentFullscreen = currentSelection ? currentSelection.message : blankMessage
yield Saga.put(Chat2Gen.createAttachmentFullscreenSelection({autoPlay: false, message: blankMessage}))
const nextAttachmentRes: Saga.RPCPromiseType<
typeof RPCChatTypes.localGetNextAttachmentMessageLocalRpcPromise
> = yield RPCChatTypes.localGetNextAttachmentMessageLocalRpcPromise({
assetTypes: [RPCChatTypes.AssetMetadataType.image, RPCChatTypes.AssetMetadataType.video],
backInTime,
convID: Types.keyToConversationID(conversationIDKey),
identifyBehavior: RPCTypes.TLFIdentifyBehavior.chatGui,
messageID,
})
const nextAttachmentRes: Saga.RPCPromiseType<typeof RPCChatTypes.localGetNextAttachmentMessageLocalRpcPromise> = yield RPCChatTypes.localGetNextAttachmentMessageLocalRpcPromise(
{
assetTypes: [RPCChatTypes.AssetMetadataType.image, RPCChatTypes.AssetMetadataType.video],
backInTime,
convID: Types.keyToConversationID(conversationIDKey),
identifyBehavior: RPCTypes.TLFIdentifyBehavior.chatGui,
messageID,
}
)

let nextMsg = currentFullscreen
if (nextAttachmentRes.message) {
Expand Down Expand Up @@ -2747,9 +2741,7 @@ function* createConversation(
return
}

const result: Saga.RPCPromiseType<
typeof RPCChatTypes.localNewConversationLocalRpcPromise
> = yield RPCChatTypes.localNewConversationLocalRpcPromise(
const result: Saga.RPCPromiseType<typeof RPCChatTypes.localNewConversationLocalRpcPromise> = yield RPCChatTypes.localNewConversationLocalRpcPromise(
{
identifyBehavior: RPCTypes.TLFIdentifyBehavior.chatGui,
membersType: RPCChatTypes.ConversationMembersType.impteamnative,
Expand Down Expand Up @@ -2861,15 +2853,11 @@ function* setConvExplodingMode(
const e: RPCError = _e
if (seconds !== 0) {
logger.error(
`Failed to set exploding mode for conversation ${conversationIDKey} to ${seconds}. Service responded with: ${
e.message
}`
`Failed to set exploding mode for conversation ${conversationIDKey} to ${seconds}. Service responded with: ${e.message}`
)
} else {
logger.error(
`Failed to unset exploding mode for conversation ${conversationIDKey}. Service responded with: ${
e.message
}`
`Failed to unset exploding mode for conversation ${conversationIDKey}. Service responded with: ${e.message}`
)
}
if (ignoreErrors.includes(e.code)) {
Expand All @@ -2885,9 +2873,7 @@ function* handleSeeingWallets(
__: Chat2Gen.HandleSeeingWalletsPayload,
logger: Saga.SagaLogger
) {
const gregorState: Saga.RPCPromiseType<
typeof RPCTypes.gregorGetStateRpcPromise
> = yield RPCTypes.gregorGetStateRpcPromise()
const gregorState: Saga.RPCPromiseType<typeof RPCTypes.gregorGetStateRpcPromise> = yield RPCTypes.gregorGetStateRpcPromise()
const seenWallets =
gregorState.items &&
gregorState.items.some(i => i.item && i.item.category === Constants.seenWalletsGregorKey)
Expand All @@ -2905,9 +2891,7 @@ function* handleSeeingWallets(
logger.info('handleSeeingWallets: successfully set seenWalletsGregorKey')
} catch (err) {
logger.error(
`handleSeeingWallets: failed to set seenWalletsGregorKey. Local state might not persist on restart. Error: ${
err.message
}`
`handleSeeingWallets: failed to set seenWalletsGregorKey. Local state might not persist on restart. Error: ${err.message}`
)
}
}
Expand All @@ -2927,9 +2911,7 @@ function* loadStaticConfig(
version: action.payload.version,
})
)
const res: Saga.RPCPromiseType<
typeof RPCChatTypes.localGetStaticConfigRpcPromise
> = yield RPCChatTypes.localGetStaticConfigRpcPromise()
const res: Saga.RPCPromiseType<typeof RPCChatTypes.localGetStaticConfigRpcPromise> = yield RPCChatTypes.localGetStaticConfigRpcPromise()
if (!res.deletableByDeleteHistory) {
logger.error('chat.loadStaticConfig: got no deletableByDeleteHistory in static config')
return
Expand Down
14 changes: 5 additions & 9 deletions shared/actions/config/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,7 @@ function* loadDaemonBootstrapStatus(
}

function* makeCall() {
const s: Saga.RPCPromiseType<
typeof RPCTypes.configGetBootstrapStatusRpcPromise
> = yield RPCTypes.configGetBootstrapStatusRpcPromise()
const s: Saga.RPCPromiseType<typeof RPCTypes.configGetBootstrapStatusRpcPromise> = yield RPCTypes.configGetBootstrapStatusRpcPromise()
const loadedAction = ConfigGen.createBootstrapStatusLoaded({
deviceID: s.deviceID,
deviceName: s.deviceName,
Expand Down Expand Up @@ -256,9 +254,7 @@ function* loadDaemonAccounts(
)
}

const configuredAccounts: Array<
RPCTypes.ConfiguredAccount
> = yield RPCTypes.loginGetConfiguredAccountsRpcPromise()
const configuredAccounts: Array<RPCTypes.ConfiguredAccount> = yield RPCTypes.loginGetConfiguredAccountsRpcPromise()
const loadedAction = ConfigGen.createSetAccounts({configuredAccounts})
yield Saga.put(loadedAction)

Expand Down Expand Up @@ -550,9 +546,9 @@ function* criticalOutOfDateCheck() {
// check every hour
while (true) {
try {
const s: Saga.RPCPromiseType<
typeof RPCTypes.configGetUpdateInfo2RpcPromise
> = yield RPCTypes.configGetUpdateInfo2RpcPromise({})
const s: Saga.RPCPromiseType<typeof RPCTypes.configGetUpdateInfo2RpcPromise> = yield RPCTypes.configGetUpdateInfo2RpcPromise(
{}
)
let status: ConfigGen.UpdateCriticalCheckStatusPayload['payload']['status'] = 'ok'
let message: string | null = null
switch (s.status) {
Expand Down
16 changes: 8 additions & 8 deletions shared/actions/fs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,9 @@ function* folderList(_: TypedState, action: FsGen.FolderListLoadPayload) {

yield RPCTypes.SimpleFSSimpleFSWaitRpcPromise({opID}, Constants.folderListWaitingKey)

const result: Saga.RPCPromiseType<
typeof RPCTypes.SimpleFSSimpleFSReadListRpcPromise
> = yield RPCTypes.SimpleFSSimpleFSReadListRpcPromise({opID})
const result: Saga.RPCPromiseType<typeof RPCTypes.SimpleFSSimpleFSReadListRpcPromise> = yield RPCTypes.SimpleFSSimpleFSReadListRpcPromise(
{opID}
)
const entries = result.entries || []
const childMap = entries.reduce((m, d) => {
const [parent, child] = d.name.split('/')
Expand Down Expand Up @@ -445,11 +445,11 @@ function* pollJournalFlushStatusUntilDone() {
syncingPaths,
totalSyncingBytes,
endEstimate,
}: Saga.RPCPromiseType<
typeof RPCTypes.SimpleFSSimpleFSSyncStatusRpcPromise
> = yield RPCTypes.SimpleFSSimpleFSSyncStatusRpcPromise({
filter: RPCTypes.ListFilter.filterSystemHidden,
})
}: Saga.RPCPromiseType<typeof RPCTypes.SimpleFSSimpleFSSyncStatusRpcPromise> = yield RPCTypes.SimpleFSSimpleFSSyncStatusRpcPromise(
{
filter: RPCTypes.ListFilter.filterSystemHidden,
}
)
yield Saga.sequentially([
Saga.put(
FsGen.createJournalUpdate({
Expand Down
4 changes: 1 addition & 3 deletions shared/actions/notifications.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,7 @@ const receivedBoxAuditError = (
) =>
ConfigGen.createGlobalError({
globalError: new Error(
`Keybase had a problem loading a team, please report this with \`keybase log send\`: ${
action.payload.params.message
}`
`Keybase had a problem loading a team, please report this with \`keybase log send\`: ${action.payload.params.message}`
),
})

Expand Down
30 changes: 15 additions & 15 deletions shared/actions/platform-specific/index.desktop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -305,11 +305,11 @@ const saveUseNativeFrame = async (state: Container.TypedState) => {

function* initializeUseNativeFrame() {
try {
const val: Saga.RPCPromiseType<
typeof RPCTypes.configGuiGetValueRpcPromise
> = yield RPCTypes.configGuiGetValueRpcPromise({
path: nativeFrameKey,
})
const val: Saga.RPCPromiseType<typeof RPCTypes.configGuiGetValueRpcPromise> = yield RPCTypes.configGuiGetValueRpcPromise(
{
path: nativeFrameKey,
}
)
const useNativeFrame = val.b === undefined || val.b === null ? defaultUseNativeFrame : val.b
yield Saga.put(ConfigGen.createSetUseNativeFrame({useNativeFrame}))
} catch (_) {}
Expand All @@ -330,11 +330,11 @@ const saveWindowState = async (state: Container.TypedState) => {
const notifySoundKey = 'notifySound'
function* initializeNotifySound() {
try {
const val: Saga.RPCPromiseType<
typeof RPCTypes.configGuiGetValueRpcPromise
> = yield RPCTypes.configGuiGetValueRpcPromise({
path: notifySoundKey,
})
const val: Saga.RPCPromiseType<typeof RPCTypes.configGuiGetValueRpcPromise> = yield RPCTypes.configGuiGetValueRpcPromise(
{
path: notifySoundKey,
}
)
const notifySound: boolean | undefined = val.b || undefined
const state: Container.TypedState = yield Saga.selectState()
if (notifySound !== undefined && notifySound !== state.config.notifySound) {
Expand All @@ -357,11 +357,11 @@ const setNotifySound = async (state: Container.TypedState) => {
const openAtLoginKey = 'openAtLogin'
function* initializeOpenAtLogin() {
try {
const val: Saga.RPCPromiseType<
typeof RPCTypes.configGuiGetValueRpcPromise
> = yield RPCTypes.configGuiGetValueRpcPromise({
path: openAtLoginKey,
})
const val: Saga.RPCPromiseType<typeof RPCTypes.configGuiGetValueRpcPromise> = yield RPCTypes.configGuiGetValueRpcPromise(
{
path: openAtLoginKey,
}
)

const openAtLogin: boolean | undefined = val.b || undefined
const state: Container.TypedState = yield Saga.selectState()
Expand Down
5 changes: 4 additions & 1 deletion shared/actions/platform-specific/push.native.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,10 @@ function* deletePushToken(state: Container.TypedState, action: ConfigGen.LogoutH
}

yield RPCTypes.apiserverDeleteRpcPromise({
args: [{key: 'device_id', value: deviceID}, {key: 'token_type', value: Constants.tokenType}],
args: [
{key: 'device_id', value: deviceID},
{key: 'token_type', value: Constants.tokenType},
],
endpoint: 'device/push_token',
})
logger.info('[PushToken] deleted from server')
Expand Down
15 changes: 6 additions & 9 deletions shared/actions/settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -357,16 +357,13 @@ const loadSettings = async (
(settings.emails || []).map(row => [row.email, Constants.makeEmailRow(row)])
)
const phoneMap: I.Map<string, Types.PhoneRow> = I.Map(
(settings.phoneNumbers || []).reduce(
(map, row) => {
if (map[row.phoneNumber] && !map[row.phoneNumber].superseded) {
return map
}
map[row.phoneNumber] = Constants.toPhoneRow(row)
(settings.phoneNumbers || []).reduce((map, row) => {
if (map[row.phoneNumber] && !map[row.phoneNumber].superseded) {
return map
},
{} as {[key: string]: Types.PhoneRow}
)
}
map[row.phoneNumber] = Constants.toPhoneRow(row)
return map
}, {} as {[key: string]: Types.PhoneRow})
)
return SettingsGen.createLoadedSettings({
emails: emailMap,
Expand Down
16 changes: 9 additions & 7 deletions shared/actions/team-building.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,15 @@ const apiSearchOne = async (
query: string,
service: TeamBuildingTypes.ServiceIdWithContact
): Promise<TeamBuildingTypes.User | undefined> =>
(await apiSearch(
query,
service,
1 /* maxResults */,
true /* serviceSummaries */,
false /* includeContacts */
))[0]
(
await apiSearch(
query,
service,
1 /* maxResults */,
true /* serviceSummaries */,
false /* includeContacts */
)
)[0]

// If the query is a well-formatted phone number or email, do additional search
// and if the result is not already in the list, insert at the beginning.
Expand Down
Loading

0 comments on commit e2777c6

Please sign in to comment.