Przeglądaj źródła

Display LessPass Server shutdown for user already connected on mobile app

tags/mobile-v9.7.6
Guillaume Vincent 1 rok temu
rodzic
commit
787ecc70e4
10 zmienionych plików z 80 dodań i 7 usunięć
  1. +2
    -2
      mobile/android/app/build.gradle
  2. +2
    -2
      mobile/ios/LessPass.xcodeproj/project.pbxproj
  3. +1
    -1
      mobile/package.json
  4. +2
    -0
      mobile/src/auth/SignInScreen.js
  5. +10
    -0
      mobile/src/messages/messagesActions.js
  6. +1
    -0
      mobile/src/messages/messagesActionsTypes.js
  7. +14
    -0
      mobile/src/messages/messagesReducer.js
  8. +44
    -0
      mobile/src/password/PasswordGeneratorScreen.js
  9. +3
    -1
      mobile/src/store.js
  10. +1
    -1
      mobile/src/version.json

+ 2
- 2
mobile/android/app/build.gradle Wyświetl plik

@@ -147,8 +147,8 @@ android {
applicationId "com.lesspass.android"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 9007005
versionName "9.7.5"
versionCode 9007006
versionName "9.7.6"
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()

if (isNewArchitectureEnabled()) {


+ 2
- 2
mobile/ios/LessPass.xcodeproj/project.pbxproj Wyświetl plik

@@ -529,7 +529,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 9.7.5;
MARKETING_VERSION = 9.7.6;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
@@ -557,7 +557,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 9.7.5;
MARKETING_VERSION = 9.7.6;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",


+ 1
- 1
mobile/package.json Wyświetl plik

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


+ 2
- 0
mobile/src/auth/SignInScreen.js Wyświetl plik

@@ -18,6 +18,7 @@ import { addError } from "../errors/errorsActions";
import { signIn } from "./authActions";
import routes from "../routes";
import { useNavigation } from "@react-navigation/native";
import { readMessage } from "../messages/messagesActions";

export default function SignInScreen() {
const [email, setEmail] = useState("");
@@ -58,6 +59,7 @@ export default function SignInScreen() {
}}
disabled={isEmpty(email) || isEmpty(password) || isLoading}
onPress={() => {
dispatch(readMessage("LessPassServerWillBeTurnedOffOnMarch"));
setIsLoading(true);
dispatch(
signIn(


+ 10
- 0
mobile/src/messages/messagesActions.js Wyświetl plik

@@ -0,0 +1,10 @@
import * as types from "./messagesActionsTypes";

export function readMessage(messageKey) {
return {
type: types.MESSAGE_READ,
payload: {
key: messageKey,
},
};
}

+ 1
- 0
mobile/src/messages/messagesActionsTypes.js Wyświetl plik

@@ -0,0 +1 @@
export const MESSAGE_READ = "MESSAGE_READ";

+ 14
- 0
mobile/src/messages/messagesReducer.js Wyświetl plik

@@ -0,0 +1,14 @@
import * as types from "./messagesActionsTypes";

const initialState = {
LessPassServerWillBeTurnedOffOnMarch: false,
};

export default function (state = initialState, action) {
switch (action.type) {
case types.MESSAGE_READ:
return { ...state, [action.payload.key]: true };
default:
return state;
}
}

+ 44
- 0
mobile/src/password/PasswordGeneratorScreen.js Wyświetl plik

@@ -6,6 +6,7 @@ import {
KeyboardAvoidingView,
Platform,
Keyboard,
Linking,
} from "react-native";
import { generatePassword } from "./passwordGenerator";
import TextInput from "../ui/TextInput";
@@ -25,6 +26,7 @@ import {
} from "./validations";
import { Button, Snackbar, Text, useTheme } from "react-native-paper";
import { addError, cleanErrors } from "../errors/errorsActions";
import { readMessage } from "../messages/messagesActions";

function _getInitialState(settings) {
return {
@@ -61,6 +63,7 @@ export default function PasswordGeneratorScreen() {
const profile = useSelector((state) => state.profile);
const settings = useSelector((state) => state.settings);
const auth = useSelector((state) => state.auth);
const messages = useSelector((state) => state.messages);
const dispatch = useDispatch();
const [copied, setCopied] = useState(false);
const [seePassword, setSeePassword] = useState(false);
@@ -68,6 +71,7 @@ export default function PasswordGeneratorScreen() {
const [updated, setUpdated] = useState(false);
const [state, setState] = useState(() => _getInitialState(settings));
const theme = useTheme();

useEffect(() => {
const newState = _getInitialState(settings);
if (profile === null) {
@@ -307,6 +311,46 @@ export default function PasswordGeneratorScreen() {
</Text>
</View>
)}
{auth.isAuthenticated &&
!messages["LessPassServerWillBeTurnedOffOnMarch"] && (
<>
<Text style={{ color: theme.colors.error, marginTop: 20 }}>
LessPass Database server will be turned off on March 1th,
2023. You can export your passwords using the web extension,
the CLI or the web site.
<Text
style={{ color: theme.colors.primary }}
onPress={() => {
Linking.openURL(
"https://blog.lesspass.com/2022-12-29/decommissioning-lesspass-database"
);
}}
>
{" "}
See announcement
</Text>
</Text>
<Button
mode="text"
onPress={() =>
dispatch(
readMessage("LessPassServerWillBeTurnedOffOnMarch")
)
}
>
<Text
style={{
color: theme.colors.error,
fontWeight: "bold",
marginTop: 5,
}}
onPress={() => {}}
>
Hide
</Text>
</Button>
</>
)}
</ScrollView>
</TouchableWithoutFeedback>
<Snackbar


+ 3
- 1
mobile/src/store.js Wyświetl plik

@@ -10,6 +10,7 @@ import authReducer from "./auth/authReducer";
import errorsReducer from "./errors/errorsReducer";
import profilesReducer from "./password/profilesReducer";
import profileReducer from "./profiles/profileReducer";
import messagesReducer from "./messages/messagesReducer";

const rootReducer = combineReducers({
settings: settingsReducer,
@@ -17,13 +18,14 @@ const rootReducer = combineReducers({
errors: errorsReducer,
profile: profileReducer,
profiles: profilesReducer,
messages: messagesReducer,
});

const persistConfig = {
key: "root",
storage: AsyncStorage,
stateReconciler,
whitelist: ["settings", "auth"],
whitelist: ["settings", "auth", "messages"],
};

const persistedReducer = persistReducer(persistConfig, rootReducer);


+ 1
- 1
mobile/src/version.json Wyświetl plik

@@ -1,3 +1,3 @@
{
"version": "9.7.5"
"version": "9.7.6"
}

Ładowanie…
Anuluj
Zapisz