mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-08-16 19:30:27 +03:00
feat(core): add dev function (#9113)
This commit is contained in:
parent
e7f245e81e
commit
9dc9ca6e38
5
.changes/dev-fn.md
Normal file
5
.changes/dev-fn.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"tauri": patch:enhance
|
||||||
|
---
|
||||||
|
|
||||||
|
Added `tauri::dev()` to determine whether we are running in development mode or not.
|
@ -333,6 +333,11 @@ macro_rules! tauri_build_context {
|
|||||||
|
|
||||||
pub use pattern::Pattern;
|
pub use pattern::Pattern;
|
||||||
|
|
||||||
|
/// Whether we are running in development mode or not.
|
||||||
|
pub fn dev() -> bool {
|
||||||
|
!cfg!(feature = "custom-protocol")
|
||||||
|
}
|
||||||
|
|
||||||
/// User supplied data required inside of a Tauri application.
|
/// User supplied data required inside of a Tauri application.
|
||||||
///
|
///
|
||||||
/// # Stability
|
/// # Stability
|
||||||
|
@ -320,7 +320,7 @@ impl<R: Runtime> AppManager<R> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn csp(&self) -> Option<Csp> {
|
fn csp(&self) -> Option<Csp> {
|
||||||
if cfg!(feature = "custom-protocol") {
|
if !crate::dev() {
|
||||||
self.config.app.security.csp.clone()
|
self.config.app.security.csp.clone()
|
||||||
} else {
|
} else {
|
||||||
self
|
self
|
||||||
|
Loading…
Reference in New Issue
Block a user