Move some code

This commit is contained in:
Pierre HUBERT 2020-06-13 17:25:16 +02:00
parent 1cbae38ee5
commit f190572d42
3 changed files with 12 additions and 3 deletions

View File

@ -63,9 +63,7 @@ void APIRequest::onResponse()
// Check if login token was destroyed
if(code == 412) {
AccountHelper::RemoveLoginToken();
RefreshService::stopService();
LoginWindow().exec();
RefreshService::signOutUser();
return;
}

View File

@ -1,3 +1,5 @@
#include "accounthelper.h"
#include "loginwindow.h"
#include "refreshservice.h"
#include <QGuiApplication>
@ -25,6 +27,13 @@ void RefreshService::stopService()
svc = nullptr;
}
void RefreshService::signOutUser()
{
AccountHelper::RemoveLoginToken();
RefreshService::stopService();
LoginWindow().exec();
}
void RefreshService::connectedToWebSocket()
{
mNotifsHelper.getNewNotificationsNumbers();

View File

@ -20,6 +20,8 @@ public:
static void startService();
static void stopService();
static void signOutUser();
private slots:
void connectedToWebSocket();
void onNewNumberNotifications(NotificationsNumber number);