Skip to content

Commit 1078a0d

Browse files
authored
Merge pull request #5588 from EdgeApp/sam/duress-mode-logging
We're not in Kansas anymore
2 parents a7b9837 + d93111d commit 1078a0d

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

src/actions/LogActions.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,13 @@ function getRepoId(key: string): string {
235235
return 'Invalid syncKey type'
236236
}
237237

238-
export const sendLogs = async (logs: LogOutput) => {
238+
export const sendLogs = async (logs: LogOutput, underDuress: boolean) => {
239239
console.log('====== SENDING LOGS REQUEST ======')
240240

241+
if (underDuress) {
242+
logs.userMessage += ' (DURESS MODE)'
243+
}
244+
241245
return await fetch(logsUri, {
242246
method: 'PUT',
243247
headers: {

src/actions/LoginActions.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,6 @@ function getFirstActiveWalletInfo(account: EdgeAccount): {
5757

5858
export function initializeAccount(navigation: NavigationBase, account: EdgeAccount): ThunkAction<Promise<void>> {
5959
return async (dispatch, getState) => {
60-
if (account.isDuressAccount) logActivity(`pineapple juice`)
61-
else logActivity(`Kansas`)
62-
6360
const rootNavigation = getRootNavigation(navigation)
6461

6562
// Log in as quickly as possible, but we do need the sort order:

src/components/modals/LogsModal.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { sprintf } from 'sprintf-js'
88
import { MultiLogOutput, sendLogs } from '../../actions/LogActions'
99
import { lstrings } from '../../locales/strings'
1010
import { config } from '../../theme/appConfig'
11+
import { useSelector } from '../../types/reactRedux'
1112
import { ModalButtons } from '../buttons/ModalButtons'
1213
import { AlertCardUi4 } from '../cards/AlertCard'
1314
import { WarningCard } from '../cards/WarningCard'
@@ -26,6 +27,7 @@ export const LogsModal = (props: Props) => {
2627
const { bridge, logs } = props
2728
const [userMessage, setUserMessage] = React.useState('')
2829
const [isKeyboardVisible, setKeyboardVisible] = React.useState(false)
30+
const account = useSelector(state => state.core.account)
2931

3032
React.useEffect(() => {
3133
const keyboardDidShowListener = Keyboard.addListener('keyboardDidShow', () => {
@@ -72,11 +74,13 @@ export const LogsModal = (props: Props) => {
7274
logs.info.userMessage = userMessage
7375
logs.activity.userMessage = userMessage
7476

77+
const underDuress = account.isDuressAccount
78+
7579
await Promise.all([
76-
sendLogs(logs.activity).catch((e: any) => {
80+
sendLogs(logs.activity, underDuress).catch((e: any) => {
7781
throw new Error(`${lstrings.settings_modal_send_logs_failure} activity logs code ${e?.message}`)
7882
}),
79-
sendLogs(logs.info).catch((e: any) => {
83+
sendLogs(logs.info, underDuress).catch((e: any) => {
8084
throw new Error(`${lstrings.settings_modal_send_logs_failure} info logs code ${e?.message}`)
8185
})
8286
])

0 commit comments

Comments
 (0)