Skip to content

Commit 073fc5b

Browse files
committed
fix: more steps in stepsAboutChange
1 parent a5e4df7 commit 073fc5b

1 file changed

Lines changed: 28 additions & 2 deletions

File tree

src/interface.ts

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,32 @@ export enum GitStep {
7171
SynchronizationFinish = 'SynchronizationFinish',
7272
}
7373
/**
74-
* Steps that indicate we have new files, so we can restart our wiki to reload changes
74+
* Steps that indicate we have new files, so we can restart our wiki to reload changes.
75+
*
76+
* @example <pre><code>
77+
* // (inside a promise)
78+
* let hasChanges = false;
79+
observable?.subscribe({
80+
next: (messageObject) => {
81+
if (messageObject.level === 'error') {
82+
return;
83+
}
84+
const { meta } = messageObject;
85+
if (typeof meta === 'object' && meta !== null && 'step' in meta && stepsAboutChange.includes((meta as { step: GitStep }).step)) {
86+
hasChanges = true;
87+
}
88+
},
89+
complete: () => {
90+
resolve(hasChanges);
91+
},
92+
});
93+
</code></pre>
7594
*/
76-
export const stepsAboutChange = [GitStep.FetchingData, GitStep.LocalStateBehindSync, GitStep.RebaseSucceed];
95+
export const stepsAboutChange = [
96+
GitStep.GitMerge,
97+
GitStep.FetchingData,
98+
GitStep.LocalStateBehindSync,
99+
GitStep.RebaseSucceed,
100+
GitStep.LocalStateDivergeRebase,
101+
GitStep.FinishForcePull,
102+
];

0 commit comments

Comments
 (0)