Browse Source

use macro ?CTX

221V 3 years ago
parent
commit
4acfde5a40
2 changed files with 2 additions and 2 deletions
  1. 1 1
      src/endpoints/n4u_document.erl
  2. 1 1
      src/wf.erl

+ 1 - 1
src/endpoints/n4u_document.erl

@@ -41,7 +41,7 @@ run(Req) ->
   Html = nitro:render(Elements),
   Actions = erlang:get(actions),
   Pid ! {'INIT', Actions},
-  Ctx2 = n4u_cx:fold(finish, Ctx#cx.handlers, erlang:get(context)),
+  Ctx2 = n4u_cx:fold(finish, Ctx#cx.handlers, ?CTX),
   Req2 = wf:response(Html, set_cookies(wf:cookies(), Ctx2#cx.req)),
   wf:info(?MODULE, "Cookies Req: ~p~n", [Req2]),
   %erlang:exit(Pid, {}),

+ 1 - 1
src/wf.erl

@@ -257,7 +257,7 @@ actions()      -> get(actions).
 actions(Ac)    -> put(actions, Ac).
 script()       -> get(script).
 script(Script) -> put(script, Script).
-context()      -> get(context).
+context()      -> ?CTX.
 context(Cx)    -> put(context, Cx).
 context(Cx,Proto)        -> n4u_cx:context(Cx, Proto).
 context(Cx,Proto,UserCx) -> n4u_cx:context(Cx, Proto, UserCx).