-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 🎸 call api->auto unlock wallet; add case; refactor;
- Loading branch information
Showing
8 changed files
with
231 additions
and
265 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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,24 @@ | ||
/** | ||
* @file LockUnlockService.js | ||
* @author hzz780 | ||
*/ | ||
|
||
import errorHandler from '../utils/errorHandler'; | ||
|
||
export default class LockService { | ||
async lockGuard(aesSeed) { | ||
return !(aesSeed && aesSeed.length) ? { | ||
...errorHandler(200005) | ||
} : { | ||
...errorHandler(0) | ||
}; | ||
} | ||
|
||
async callUnLockPagePrompt(Background, sendResponse) { | ||
Background.openPrompt(sendResponse,{ | ||
payload: { | ||
method: 'UNLOCK_NIGHT_ELF' | ||
} | ||
}); | ||
} | ||
} |
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 |
---|---|---|
|
@@ -120,5 +120,4 @@ export default class NotificationService { | |
window.close(); | ||
} | ||
} | ||
|
||
} |
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,17 @@ | ||
/** | ||
* @file utils/getPromptRoute.js | ||
* @author hzz780 | ||
* 2020.08.18 | ||
*/ | ||
|
||
export default function getPromptRoute(message) { | ||
let method = message.payload.method ? message.payload.method : message.payload.payload.method; | ||
const routMap = { | ||
SET_PERMISSION: '#/', | ||
SET_CONTRACT_PERMISSION: '#/', | ||
LOGIN: '#/loginkeypairs', | ||
CALL_AELF_CONTRACT: '#/examine-approve', | ||
UNLOCK_NIGHT_ELF: '#/unlock' | ||
}; | ||
return message.router || routMap[method] || '#/confirmation'; | ||
} |
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