Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ceeadaa2 authored by theronakpatel's avatar theronakpatel
Browse files

Loadstate added

parent b249525d
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ use OCP\ISession;
use OCP\IURLGenerator;
use OCP\IUserSession;
use OCP\L10N\IFactory;

use OCP\AppFramework\Services\IInitialState;
class AccountController extends Controller {
	protected $appName;
	protected $request;
@@ -39,6 +39,7 @@ class AccountController extends Controller {
	private $urlGenerator;
	/** @var IConfig */
	private IConfig $config;
	private IInitialState $initialState;
	private const SESSION_USERNAME_CHECK = 'username_check_passed';
	private const CAPTCHA_VERIFIED_CHECK = 'captcha_verified';
	private ILogger $logger;
@@ -53,6 +54,7 @@ class AccountController extends Controller {
		IURLGenerator $urlGenerator,
		ISession $session,
		IConfig $config,
		IInitialState $initialState,
		ILogger $logger
	) {
		parent::__construct($AppName, $request);
@@ -67,6 +69,7 @@ class AccountController extends Controller {
		$this->urlGenerator = $urlGenerator;
		$this->logger = $logger;
		$this->request = $request;
		$this->initialState = $initialState;
	}

	/**
@@ -83,7 +86,7 @@ class AccountController extends Controller {
		}

		$_SERVER['HTTP_ACCEPT_LANGUAGE'] = $lang;

		$this->initialState->provideInitialState('lang', $lang);
		return new TemplateResponse(
			Application::APP_ID,
			'signup',
+2 −7
Original line number Diff line number Diff line
@@ -162,7 +162,7 @@
import Axios from '@nextcloud/axios'
import Password from 'vue-password-strength-meter'
import { generateUrl } from '@nextcloud/router'

import { loadState } from '@nextcloud/initial-state'
const APPLICATION_NAME = 'ecloud-accounts'

export default {
@@ -212,12 +212,7 @@ export default {
		},
	},
	created() {
		const currentURL = window.location.href
		const urlSegments = currentURL.split('/')
		const languages = ['de', 'fr', 'it', 'es', 'en']
		const potentialLang = urlSegments[urlSegments.length - 2]

		this.formData.selectedLanguage = languages.includes(potentialLang) ? potentialLang : 'en'
		this.formData.selectedLanguage = loadState(this.appName, 'lang')
	},
	methods: {
		validateForm(fieldsToValidate) {