Skip to content

Commit

Permalink
API: Enable/disable cloud for app
Browse files Browse the repository at this point in the history
  • Loading branch information
catloversg committed Aug 9, 2024
1 parent fa6c6af commit f5f80fb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions client.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export declare namespace callback {
export declare namespace cloud {
export function isEnabledForAccount(): boolean
export function isEnabledForApp(): boolean
export function setEnabledForApp(enabled: boolean): void
export function readFile(name: string): string
export function writeFile(name: string, content: string): boolean
export function deleteFile(name: string): boolean
Expand Down
6 changes: 6 additions & 0 deletions src/api/cloud.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ pub mod cloud {
client.remote_storage().is_cloud_enabled_for_app()
}

#[napi]
pub fn set_enabled_for_app(enabled: bool) {
let client = crate::client::get_client();
client.remote_storage().set_cloud_enabled_for_app(enabled)
}

#[napi]
pub fn read_file(name: String) -> Result<String, Error> {
let client = crate::client::get_client();
Expand Down

0 comments on commit f5f80fb

Please sign in to comment.