Skip to content

Commit 40c81b1

Browse files
PR Batch Testershivamhwp
authored andcommitted
fix(mobile): refresh repository accounts after sign-in changes
1 parent 6801eb2 commit 40c81b1

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

‎apps/mobile/src/features/settings/components/SourceControlSignInSection.tsx‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ function OfferedAppSignIn(props: {
8686
definition={props.definition}
8787
appSignIn={props.appSignIn}
8888
disabled={props.disabled}
89+
onChanged={discovery.refresh}
8990
/>
9091
</SettingsSection>
9192
);
@@ -97,6 +98,7 @@ function AppSignInRow(props: {
9798
readonly definition: SourceControlDefinition;
9899
readonly appSignIn: SourceControlAppSignIn;
99100
readonly disabled: boolean;
101+
readonly onChanged: () => void;
100102
}) {
101103
const { environment, definition, appSignIn } = props;
102104
const environmentId = environment.environmentId;
@@ -155,11 +157,13 @@ function AppSignInRow(props: {
155157
setPending(null);
156158
if (finished._tag !== "Success") {
157159
Alert.alert("Sign-in did not finish", failureMessage(finished.cause));
160+
} else {
161+
props.onChanged();
158162
}
159163
};
160164

161-
const signOut = () =>
162-
void updateSettings({
165+
const signOut = async () => {
166+
const result = await updateSettings({
163167
environmentId,
164168
// Send the whole map; other hosts' redaction markers preserve their sessions.
165169
input: {
@@ -168,6 +172,8 @@ function AppSignInRow(props: {
168172
},
169173
},
170174
});
175+
if (result._tag === "Success") props.onChanged();
176+
};
171177

172178
const onPress = () => {
173179
if (signedIn) {

0 commit comments

Comments
 (0)