浏览代码

Add an option to NOT copy the password when generating

Fixes https://github.com/lesspass/lesspass/issues/673
pull/674/head
Guillaume Vincent 3 年前
父节点
当前提交
bab758c12b
共有 7 个文件被更改,包括 43 次插入12 次删除
  1. +2
    -2
      mobile/ios/LessPass.xcodeproj/project.pbxproj
  2. +1
    -1
      mobile/package.json
  3. +24
    -7
      mobile/src/password/PasswordGeneratorScreen.js
  4. +13
    -1
      mobile/src/settings/SettingsScreen.js
  5. +1
    -0
      mobile/src/settings/settingsReducer.js
  6. +1
    -0
      mobile/src/settings/settingsReducer.test.js
  7. +1
    -1
      mobile/src/version.json

+ 2
- 2
mobile/ios/LessPass.xcodeproj/project.pbxproj 查看文件

@@ -355,7 +355,7 @@
);
INFOPLIST_FILE = LessPass/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 9.5.3;
MARKETING_VERSION = 9.6.0;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
@@ -384,7 +384,7 @@
DEVELOPMENT_TEAM = 5Y4MF2AT83;
INFOPLIST_FILE = LessPass/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 9.5.3;
MARKETING_VERSION = 9.6.0;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",


+ 1
- 1
mobile/package.json 查看文件

@@ -1,6 +1,6 @@
{
"name": "lesspass-mobile",
"version": "9.5.3",
"version": "9.6.0",
"description": "LessPass mobile application",
"license": "(MPL-2.0 OR GPL-3.0)",
"author": "Guillaume Vincent <guillaume@oslab.fr>",


+ 24
- 7
mobile/src/password/PasswordGeneratorScreen.js 查看文件

@@ -38,6 +38,7 @@ function _getInitialState(settings) {
symbols: settings.defaultSymbols,
length: settings.defaultGeneratedPasswordLength,
counter: settings.defaultCounter,
copyPasswordAfterGeneration: settings.copyPasswordAfterGeneration,
password: null,
};
}
@@ -161,8 +162,10 @@ export default function PasswordGeneratorScreen() {
state.masterPassword,
passwordProfile
);
Clipboard.setString(password);
setCopied(true);
if (state.copyPasswordAfterGeneration) {
Clipboard.setString(password);
setCopied(true);
}
setState((state) => ({ ...state, password }));
} else {
dispatch(
@@ -173,13 +176,13 @@ export default function PasswordGeneratorScreen() {
}
}}
>
GENERATE & COPY
{state.copyPasswordAfterGeneration ? "GENERATE & COPY" : "GENERATE"}
</Button>
<View
style={{
marginTop: 20,
flexDirection: "row",
justifyContent: "space-between",
flexWrap: "wrap",
}}
>
<Button
@@ -193,10 +196,24 @@ export default function PasswordGeneratorScreen() {
setState(_getInitialState(settings));
dispatch(cleanPasswordProfile());
}}
style={{ marginRight: 10, marginBottom: 10 }}
icon="refresh"
>
clear
</Button>
{state.password && state.copyPasswordAfterGeneration === false && (
<Button
mode="outlined"
onPress={() => {
Clipboard.setString(state.password);
setCopied(true);
}}
icon="clipboard"
style={{ marginRight: 10, marginBottom: 10 }}
>
Copy
</Button>
)}
{state.password && (
<Button
mode="outlined"
@@ -204,7 +221,7 @@ export default function PasswordGeneratorScreen() {
setSeePassword((seePassword) => !seePassword);
}}
icon="eye"
style={{ marginLeft: 5 }}
style={{ marginRight: 10, marginBottom: 10 }}
>
{seePassword ? "hide" : "show"}
</Button>
@@ -223,7 +240,7 @@ export default function PasswordGeneratorScreen() {
);
}}
icon="content-save"
style={{ marginLeft: 5 }}
style={{ marginRight: 10, marginBottom: 10 }}
>
Save
</Button>
@@ -240,7 +257,7 @@ export default function PasswordGeneratorScreen() {
);
}}
icon="content-save"
style={{ marginLeft: 5 }}
style={{ marginRight: 10, marginBottom: 10 }}
>
Update
</Button>


+ 13
- 1
mobile/src/settings/SettingsScreen.js 查看文件

@@ -42,6 +42,7 @@ export class SettingsScreen extends Component {
defaultDigits,
defaultSymbols,
defaultCounter,
copyPasswordAfterGeneration,
} = settings;
return (
<ScrollView>
@@ -162,9 +163,20 @@ export class SettingsScreen extends Component {
</>
)}
<List.Section title="APPLICATION">
<Switch
label="Copy password automatically"
description={
copyPasswordAfterGeneration ? "Your password will be copied automatically after it is generated." : "Your password will not be copied automatically after it is generated."
}
value={copyPasswordAfterGeneration}
onChange={(value) =>
setSettings({ copyPasswordAfterGeneration: value })
}
/>
<Divider />
<List.Item title={`LessPass version: ${version}`} />
<Divider />
</List.Section>
<Divider />
</ScrollView>
);
}


+ 1
- 0
mobile/src/settings/settingsReducer.js 查看文件

@@ -11,6 +11,7 @@ const initialState = {
defaultDigits: defaultPasswordProfile.digits,
defaultSymbols: defaultPasswordProfile.symbols,
defaultCounter: defaultPasswordProfile.counter,
copyPasswordAfterGeneration: true,
};

export default function (state = initialState, action) {


+ 1
- 0
mobile/src/settings/settingsReducer.test.js 查看文件

@@ -13,6 +13,7 @@ describe("settings reducer", () => {
defaultDigits: true,
defaultSymbols: true,
defaultCounter: 1,
copyPasswordAfterGeneration: true,
});
});
it("SET_SETTINGS", () => {


+ 1
- 1
mobile/src/version.json 查看文件

@@ -1,3 +1,3 @@
{
"version": "9.5.3"
"version": "9.6.0"
}

正在加载...
取消
保存