summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorMartin Kagamino Lehoux <martin@lehoux.net>2023-10-24 08:30:28 +0200
committerMartin Kagamino Lehoux <martin@lehoux.net>2023-10-24 08:30:28 +0200
commited23d402fec268e163ec895748f43e3254ba3dfd (patch)
tree1b3b214eabe9ff8d2a18803c64e47f54f6a1fd2d /core
parenta4f3f4ddfafe102232d3341cd432219a40a0d64e (diff)
refactor: Rename & include more featuresv0.2.0
Diffstat (limited to 'core')
-rw-r--r--core/template.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/core/template.go b/core/template.go
index 3a6833a..a0d0668 100644
--- a/core/template.go
+++ b/core/template.go
@@ -18,16 +18,16 @@ func GetTr(wl WithLanguage) Tr {
return func(format string, args ...any) string { return i18n.Tr(lang, format, args...) }
}
-type LoginContext[U any] struct {
- IsLoggedIn bool
- User U
- Tr Tr
+type Login[U any] struct {
+ Ok bool
+ User U
+ Tr Tr
}
-func GetLoginContext[U WithLanguage](user U, ok bool) LoginContext[U] {
- return LoginContext[U]{
- IsLoggedIn: ok,
- User: user,
- Tr: GetTr(user),
+func LoginFromUser[U WithLanguage](user U, ok bool) Login[U] {
+ return Login[U]{
+ Ok: ok,
+ User: user,
+ Tr: GetTr(user),
}
}