Ver código fonte

Add an option to NOT copy the password when generating

Fixes https://github.com/lesspass/lesspass/issues/673
pull/674/head
Guillaume Vincent 3 anos atrás
pai
commit
bab758c12b
7 arquivos alterados com 43 adições e 12 exclusões
  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 Ver arquivo

@@ -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 Ver arquivo

@@ -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 Ver arquivo

@@ -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 Ver arquivo

@@ -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 Ver arquivo

@@ -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 Ver arquivo

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


+ 1
- 1
mobile/src/version.json Ver arquivo

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

Carregando…
Cancelar
Salvar