mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-06 20:37:09 +02:00
Startings of needsLogin support
This commit is contained in:
parent
e1789996fb
commit
ef2e5f78ff
1 changed files with 13 additions and 15 deletions
|
@ -149,16 +149,16 @@ function onMessage(message) {
|
||||||
Settings.setValue("previousStillSnapSharingDisabled", true);
|
Settings.setValue("previousStillSnapSharingDisabled", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isLoggedIn) {
|
||||||
|
print('Modifying audience of story ID', message.story_id, "to 'for_feed'");
|
||||||
var requestBody = {
|
var requestBody = {
|
||||||
audience: "for_feed"
|
audience: "for_feed"
|
||||||
}
|
}
|
||||||
|
|
||||||
if (message.isAnnouncement) {
|
if (message.isAnnouncement) {
|
||||||
requestBody.action = "announcement";
|
requestBody.action = "announcement";
|
||||||
|
print('...Also announcing!');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isLoggedIn) {
|
|
||||||
print('Modifying audience of story ID', message.story_id, "to 'for_feed'");
|
|
||||||
request({
|
request({
|
||||||
uri: METAVERSE_BASE + '/api/v1/user_stories/' + message.story_id,
|
uri: METAVERSE_BASE + '/api/v1/user_stories/' + message.story_id,
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
|
@ -178,14 +178,10 @@ function onMessage(message) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// TODO
|
|
||||||
/*
|
|
||||||
needsLogin = true;
|
needsLogin = true;
|
||||||
shareAfterLogin = true;
|
shareAfterLogin = true;
|
||||||
snapshotToShareAfterLogin = { path: message.data, href: message.href || href };
|
snapshotToShareAfterLogin = { path: message.data, href: message.href || href };
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
if (needsLogin) {
|
if (needsLogin) {
|
||||||
if ((HMD.active && Settings.getValue("hmdTabletBecomesToolbar"))
|
if ((HMD.active && Settings.getValue("hmdTabletBecomesToolbar"))
|
||||||
|| (!HMD.active && Settings.getValue("desktopTabletBecomesToolbar"))) {
|
|| (!HMD.active && Settings.getValue("desktopTabletBecomesToolbar"))) {
|
||||||
|
@ -194,7 +190,7 @@ function onMessage(message) {
|
||||||
tablet.loadQMLOnTop("../../dialogs/TabletLoginDialog.qml");
|
tablet.loadQMLOnTop("../../dialogs/TabletLoginDialog.qml");
|
||||||
HMD.openTablet();
|
HMD.openTablet();
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
break;
|
break;
|
||||||
case 'shareButtonClicked':
|
case 'shareButtonClicked':
|
||||||
print('Twitter or FB "Share" button clicked! Removing ID', message.story_id, 'from storyIDsToMaybeDelete[].');
|
print('Twitter or FB "Share" button clicked! Removing ID', message.story_id, 'from storyIDsToMaybeDelete[].');
|
||||||
|
@ -265,8 +261,10 @@ function takeSnapshot() {
|
||||||
}));
|
}));
|
||||||
Settings.setValue("previousStillSnapPath", "");
|
Settings.setValue("previousStillSnapPath", "");
|
||||||
Settings.setValue("previousStillSnapStoryID", "");
|
Settings.setValue("previousStillSnapStoryID", "");
|
||||||
|
Settings.setValue("previousStillSnapSharingDisabled", false);
|
||||||
Settings.setValue("previousAnimatedSnapPath", "");
|
Settings.setValue("previousAnimatedSnapPath", "");
|
||||||
Settings.setValue("previousAnimatedSnapStoryID", "");
|
Settings.setValue("previousAnimatedSnapStoryID", "");
|
||||||
|
Settings.setValue("previousAnimatedSnapSharingDisabled", false);
|
||||||
|
|
||||||
// Raising the desktop for the share dialog at end will interact badly with clearOverlayWhenMoving.
|
// Raising the desktop for the share dialog at end will interact badly with clearOverlayWhenMoving.
|
||||||
// Turn it off now, before we start futzing with things (and possibly moving).
|
// Turn it off now, before we start futzing with things (and possibly moving).
|
||||||
|
@ -452,7 +450,7 @@ function onTabletScreenChanged(type, url) {
|
||||||
isInSnapshotReview = false;
|
isInSnapshotReview = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function onConnected() {
|
function onUsernameChanged() {
|
||||||
if (shareAfterLogin && Account.isLoggedIn()) {
|
if (shareAfterLogin && Account.isLoggedIn()) {
|
||||||
print('Sharing snapshot after login:', snapshotToShareAfterLogin.path);
|
print('Sharing snapshot after login:', snapshotToShareAfterLogin.path);
|
||||||
Window.shareSnapshot(snapshotToShareAfterLogin.path, snapshotToShareAfterLogin.href);
|
Window.shareSnapshot(snapshotToShareAfterLogin.path, snapshotToShareAfterLogin.href);
|
||||||
|
@ -464,7 +462,7 @@ button.clicked.connect(openSnapApp);
|
||||||
buttonConnected = true;
|
buttonConnected = true;
|
||||||
Window.snapshotShared.connect(snapshotUploaded);
|
Window.snapshotShared.connect(snapshotUploaded);
|
||||||
tablet.screenChanged.connect(onTabletScreenChanged);
|
tablet.screenChanged.connect(onTabletScreenChanged);
|
||||||
Account.usernameChanged.connect(onConnected);
|
Account.usernameChanged.connect(onUsernameChanged);
|
||||||
Script.scriptEnding.connect(function () {
|
Script.scriptEnding.connect(function () {
|
||||||
if (buttonConnected) {
|
if (buttonConnected) {
|
||||||
button.clicked.disconnect(openSnapApp);
|
button.clicked.disconnect(openSnapApp);
|
||||||
|
|
Loading…
Reference in a new issue