-
-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Vitor Mattos <vitor@php.rio>
- Loading branch information
1 parent
c4b306e
commit ee7e36f
Showing
4 changed files
with
91 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/** | ||
* SPDX-FileCopyrightText: 2025 LibreCode coop and contributors | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
*/ | ||
|
||
import { defineStore } from 'pinia' | ||
import { loadState } from '@nextcloud/initial-state' | ||
|
||
export const useIdentificationDocumentStore = function(...args) { | ||
const store = defineStore('identificationDocument', { | ||
state: () => ({ | ||
modal: false, | ||
enabled: loadState('libresign', 'needIdentificationDocuments', false), | ||
waitingApproval: loadState('libresign', 'identificationDocumentsWaitingApproval', false), | ||
}), | ||
actions: { | ||
needIdentificationDocument() { | ||
return this.enabled && !this.waitingApproval | ||
}, | ||
setEnabled(enabled) { | ||
this.enabled = enabled | ||
}, | ||
setWaitingApproval(waitingApproval) { | ||
this.waitingApproval = waitingApproval | ||
}, | ||
showModal() { | ||
this.modal = true | ||
}, | ||
closeModal() { | ||
this.modal = false | ||
} | ||
}, | ||
}) | ||
|
||
const identificationDocumentStore = store(...args) | ||
|
||
// Make sure we only register the listeners once | ||
if (!identificationDocumentStore._initialized) { | ||
identificationDocumentStore._initialized = true | ||
} | ||
|
||
return identificationDocumentStore | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters