mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 23:19:40 +01:00
core: add function for checking compability with server
This commit is contained in:
committed by
Abdullah Atta
parent
31453dc098
commit
cc3ccd041d
@@ -32,3 +32,4 @@ export {
|
||||
type TextSlice
|
||||
} from "./utils/content-block";
|
||||
export { type DatabaseUpdatedEvent } from "./database";
|
||||
export { isServerCompatible } from "./utils/constants";
|
||||
|
||||
@@ -19,6 +19,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import { extractHostname } from "./hostname";
|
||||
|
||||
const COMPATIBLE_SERVER_VERSION = 1;
|
||||
|
||||
export function isServerCompatible(version: number) {
|
||||
return COMPATIBLE_SERVER_VERSION === version;
|
||||
}
|
||||
|
||||
function isProduction() {
|
||||
return (
|
||||
process.env.NODE_ENV === "production" || process.env.NODE_ENV === "test"
|
||||
|
||||
Reference in New Issue
Block a user