Skip to content

Commit

Permalink
refactor: Remove unused code and optimize imports
Browse files Browse the repository at this point in the history
The code changes in `ScanQRCode.js` remove unused code related to supported protocols and optimize imports. This improves code readability and reduces unnecessary complexity.

This commit message follows the established convention of starting with a verb in the imperative form ("Remove", "Optimize") and providing a concise summary of the changes made.
  • Loading branch information
IZUMI-Zu committed Aug 25, 2024
1 parent a179eab commit 8beb671
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
5 changes: 0 additions & 5 deletions ScanQRCode.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,8 @@ const ScanQRCode = ({onClose, showScanner, onAdd}) => {

const handleBarCodeScanned = ({type, data}) => {
// console.log(`Bar code with type ${type} and data ${data} has been scanned!`);

// 定义支持的协议
const supportedProtocols = ["otpauth", "otpauth-migration"];

// 使用正则表达式匹配支持的协议
const protocolMatch = data.match(new RegExp(`^(${supportedProtocols.join("|")}):`));

if (protocolMatch) {
const protocol = protocolMatch[1];
switch (protocol) {
Expand Down
10 changes: 4 additions & 6 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,16 @@
[
"expo-camera",
{
"cameraPermission": "Allow $(PRODUCT_NAME) to access your camera",
"microphonePermission": "Allow $(PRODUCT_NAME) to access your microphone",
"recordAudioAndroid": true
"cameraPermission": "Allow $(PRODUCT_NAME) to access your camera"
}
],
"expo-asset",
[
"expo-image-picker",
{
"photosPermission": "The app accesses your photos to let you share them with your friends."
"photosPermission": "The app accesses your photos to add Totp account."
}
]
],
"expo-asset"
],
"owner": "zzbs"
}
Expand Down

0 comments on commit 8beb671

Please sign in to comment.