mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-18 19:31:37 -05:00
Notify user when login is required
This commit is contained in:
parent
5be6094214
commit
f6d44f1a46
@ -31,6 +31,8 @@ QtObject
|
|||||||
property int loginAttemptCount: 0
|
property int loginAttemptCount: 0
|
||||||
property bool attemptingLogin: false
|
property bool attemptingLogin: false
|
||||||
|
|
||||||
|
property int loginNotificationTime: 0
|
||||||
|
|
||||||
function delay(msecs, func)
|
function delay(msecs, func)
|
||||||
{
|
{
|
||||||
var tmr = Qt.createQmlObject("import QtQml 2.2; Timer {}", am);
|
var tmr = Qt.createQmlObject("import QtQml 2.2; Timer {}", am);
|
||||||
@ -74,6 +76,14 @@ QtObject
|
|||||||
coreReady = false
|
coreReady = false
|
||||||
if(!attemptingLogin && loginAttemptCount < 5)
|
if(!attemptingLogin && loginAttemptCount < 5)
|
||||||
rsApi.request("/control/locations/", "", requestLocationsListCB)
|
rsApi.request("/control/locations/", "", requestLocationsListCB)
|
||||||
|
else if (loginAttemptCount >= 5 &&
|
||||||
|
/* Avoid flooding non logged in with login requests, wait
|
||||||
|
* at least 1 hour before notifying the user again */
|
||||||
|
Date.now() - loginNotificationTime > 3600000)
|
||||||
|
{
|
||||||
|
notificationsBridge.notify(qsTr("Login needed"))
|
||||||
|
loginNotificationTime = Date.now()
|
||||||
|
}
|
||||||
break
|
break
|
||||||
case "waiting_startup":
|
case "waiting_startup":
|
||||||
coreReady = false
|
coreReady = false
|
||||||
|
Loading…
Reference in New Issue
Block a user