aboutsummaryrefslogtreecommitdiffstats
path: root/teleterm-web/src/config.rs
blob: d9308deb0225f4d173589b52b6b100071d7a654f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use crate::prelude::*;

#[wasm_bindgen]
extern "C" {
    #[wasm_bindgen]
    static TELETERM_CONFIG: JsValue;
}

#[derive(Clone, Debug, serde::Deserialize)]
pub(crate) struct Config {
    pub(crate) title: String,
    pub(crate) public_address: String,
}

impl Config {
    pub(crate) fn load() -> Self {
        TELETERM_CONFIG.into_serde().unwrap()
    }
}