parent
e864b38ec6
commit
4fa78d7cd2
@ -1,7 +1,5 @@
|
||||
import { ICurrentUser } from '@/types/current-user.model';
|
||||
export interface IConfig {
|
||||
name: string,
|
||||
|
||||
export interface ILogin {
|
||||
user: ICurrentUser,
|
||||
|
||||
token: string,
|
||||
registrationsOpen: boolean,
|
||||
}
|
||||
|
@ -1,7 +1,20 @@
|
||||
defmodule Mobilizon.CommonConfig do
|
||||
def registrations_open?(), do: instance_config() |> get_in([:registrations_open])
|
||||
@moduledoc """
|
||||
Instance configuration wrapper
|
||||
"""
|
||||
|
||||
def instance_name(), do: instance_config() |> get_in([:name])
|
||||
def registrations_open?() do
|
||||
instance_config()
|
||||
|> get_in([:registrations_open])
|
||||
|> to_bool
|
||||
end
|
||||
|
||||
def instance_name() do
|
||||
instance_config()
|
||||
|> get_in([:name])
|
||||
end
|
||||
|
||||
defp instance_config(), do: Application.get_env(:mobilizon, :instance)
|
||||
|
||||
defp to_bool(v), do: v == true or v == "true" or v == "True"
|
||||
end
|
||||
|
Loading…
Reference in new issue