Skip to content

Commit

Permalink
Merge pull request #158 from catloversg/pull-request/api/enable-disab…
Browse files Browse the repository at this point in the history
…le-cloud-for-app

API: Enable/disable cloud for app
  • Loading branch information
ceifa authored Sep 14, 2024
2 parents fa6c6af + f5f80fb commit f279a62
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 f279a62

Please sign in to comment.