Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning message before unsubscribing from streams #5578

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/alert.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>

</body>
</html>
18 changes: 18 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

113 changes: 113 additions & 0 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
rootProject.name = 'ZulipMobile'

apply from: '../node_modules/expo/scripts/autolinking.gradle'
apply from: '../node_modules/expo/scripts/autolinking.gradle'
useExpoModules()

apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle");
Expand Down
1 change: 0 additions & 1 deletion src/common/ZulipButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ type Props = $ReadOnly<{|
/**
* A button component that is provides consistent look and feel
* throughout the app. It can be disabled or show action-in-progress.
*
* If several buttons are on the same screen all or all but one should
* have their `secondary` property set to `true`.
*
Expand Down
13 changes: 9 additions & 4 deletions src/streams/StreamSettingsScreen.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* @flow strict-local */
import React, { useCallback } from 'react';
/* @flow strict-local */
import React, { useCallback } ,{useState} from 'react';
import type { Node } from 'react';
import { View } from 'react-native';
import { View,Alert} from 'react-native';

import type { RouteProp } from '../react-navigation';
import type { AppNavigationProp } from '../nav/AppNavigator';
Expand Down Expand Up @@ -42,6 +42,11 @@ export default function StreamSettingsScreen(props: Props): Node {
},
[auth, stream],
);
const alert_button = () =>
Alert.alert("Do you want to unsubscribe?",
[{text:"Cancel",onPress: () => console.log("Cancel Pressed"),style: "cancel"},{text:"OK",
onPress: () => delay(handlePressUnsubscribe)}]
);

const handleToggleMuteStream = useCallback(
(newValue: boolean) => {
Expand Down Expand Up @@ -128,7 +133,7 @@ export default function StreamSettingsScreen(props: Props): Node {
style={styles.marginTop}
text="Unsubscribe"
secondary
onPress={() => delay(handlePressUnsubscribe)}
onPress={this.alert_button}
/>
) : (
<ZulipButton
Expand Down