Menghapus cek izin dan minta izin
This commit is contained in:
1 parent
f98cd2169a
commit
c195d2bc99
12 files changed
+6
-160
No files matched your search
@@ -4,16 +4,6 @@ use crate::BluclasExt;
|
||||
use crate::Result;
|
||||
use crate::models::*;
|
||||
|
||||
#[command]
|
||||
pub(crate) async fn cek_izin<R: Runtime>(app: AppHandle<R>) -> Result<String> {
|
||||
return app.bluclas().cek_izin();
|
||||
}
|
||||
|
||||
#[command]
|
||||
pub(crate) async fn minta_izin<R: Runtime>(app: AppHandle<R>) -> Result<()> {
|
||||
return app.bluclas().minta_izin();
|
||||
}
|
||||
|
||||
#[command]
|
||||
pub(crate) async fn daftar_perangkat<R: Runtime>(
|
||||
app: AppHandle<R>,
|
||||
|
||||
@@ -14,14 +14,6 @@ pub fn init<R: Runtime, C: DeserializeOwned>(
|
||||
pub struct Bluclas<R: Runtime>(AppHandle<R>);
|
||||
|
||||
impl<R: Runtime> Bluclas<R> {
|
||||
pub fn cek_izin(&self) -> crate::Result<String> {
|
||||
return Ok(String::new());
|
||||
}
|
||||
|
||||
pub fn minta_izin(&self) -> crate::Result<()> {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
pub fn daftar_perangkat(&self) -> crate::Result<SBlueclasResponDaftarPerangkat> {
|
||||
return Ok(SBlueclasResponDaftarPerangkat { data: vec![] });
|
||||
}
|
||||
|
||||
+2
-7
@@ -1,4 +1,4 @@
|
||||
use crate::commands::{cek_izin, daftar_perangkat, kirim, minta_izin};
|
||||
use crate::commands::{daftar_perangkat, kirim};
|
||||
use tauri::{
|
||||
Manager, Runtime,
|
||||
plugin::{Builder, TauriPlugin},
|
||||
@@ -36,12 +36,7 @@ impl<R: Runtime, T: Manager<R>> crate::BluclasExt<R> for T {
|
||||
/// Initializes the plugin.
|
||||
pub fn init<R: Runtime>() -> TauriPlugin<R> {
|
||||
Builder::new("bluclas")
|
||||
.invoke_handler(tauri::generate_handler![
|
||||
cek_izin,
|
||||
minta_izin,
|
||||
daftar_perangkat,
|
||||
kirim
|
||||
])
|
||||
.invoke_handler(tauri::generate_handler![daftar_perangkat, kirim])
|
||||
.setup(|app, api| {
|
||||
#[cfg(mobile)]
|
||||
let bluclas = mobile::init(app, api)?;
|
||||
|
||||
@@ -25,20 +25,6 @@ pub fn init<R: Runtime, C: DeserializeOwned>(
|
||||
pub struct Bluclas<R: Runtime>(PluginHandle<R>);
|
||||
|
||||
impl<R: Runtime> Bluclas<R> {
|
||||
pub fn cek_izin(&self) -> crate::Result<String> {
|
||||
return self
|
||||
.0
|
||||
.run_mobile_plugin("checkPermissions", ())
|
||||
.map_err(Into::into);
|
||||
}
|
||||
|
||||
pub fn minta_izin(&self) -> crate::Result<()> {
|
||||
return self
|
||||
.0
|
||||
.run_mobile_plugin("requestPermissions", ())
|
||||
.map_err(Into::into);
|
||||
}
|
||||
|
||||
pub fn daftar_perangkat(&self) -> crate::Result<SBlueclasResponDaftarPerangkat> {
|
||||
return self
|
||||
.0
|
||||
|
||||
Reference in new issue
Block a user