fix(docs): include write-protection flags in dirty check (#310)
This commit is contained in:
@@ -27,6 +27,8 @@ export interface DocDirtyState {
|
||||
themeColorsDirty: boolean
|
||||
commentsDirty: boolean
|
||||
protectionDirty: boolean
|
||||
writeProtectionDirty: boolean
|
||||
removePersonalInfoDirty: boolean
|
||||
}
|
||||
|
||||
export function isDocDirty(s: DocDirtyState): boolean {
|
||||
@@ -53,6 +55,8 @@ export function isDocDirty(s: DocDirtyState): boolean {
|
||||
s.themeFontsDirty ||
|
||||
s.themeColorsDirty ||
|
||||
s.commentsDirty ||
|
||||
s.protectionDirty
|
||||
s.protectionDirty ||
|
||||
s.writeProtectionDirty ||
|
||||
s.removePersonalInfoDirty
|
||||
)
|
||||
}
|
||||
|
||||
@@ -27,6 +27,8 @@ function cleanState(): DocDirtyState {
|
||||
themeColorsDirty: false,
|
||||
commentsDirty: false,
|
||||
protectionDirty: false,
|
||||
writeProtectionDirty: false,
|
||||
removePersonalInfoDirty: false,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,6 +52,8 @@ describe('isDocDirty', () => {
|
||||
it.each([
|
||||
['commentsDirty', { commentsDirty: true }],
|
||||
['protectionDirty', { protectionDirty: true }],
|
||||
['writeProtectionDirty', { writeProtectionDirty: true }],
|
||||
['removePersonalInfoDirty', { removePersonalInfoDirty: true }],
|
||||
['sectionDirty', { sectionDirty: true }],
|
||||
['headerDirty', { headerDirty: true }],
|
||||
['footerDirty', { footerDirty: true }],
|
||||
|
||||
Reference in New Issue
Block a user