sorting out merge stuff

This commit is contained in:
Me
2023-01-05 12:31:47 +01:00
parent eab2749c0e
commit 730b8c4e4a
2 changed files with 48 additions and 48 deletions

View File

@@ -2531,7 +2531,7 @@ var app = (function () {
validate_slots('Header', slots, []);
let handleClickLogout = async () => {
await fetch(`http://${'localhost'}:${'8080'}/api/v2/auth/logout`, { method: 'POST' }).then(() => push('/'));
await fetch(`http://${'transcendance'}:${'8080'}/api/v2/auth/logout`, { method: 'POST' }).then(() => push('/'));
console.log('clicked logout header');
};
@@ -2877,7 +2877,7 @@ var app = (function () {
onMount(async () => {
// using this for now cuz for some reason there is yet to be a way to fet another person's avatar
if (primary) {
await fetch(`http://${'localhost'}:${'8080'}/api/v2/user/avatar`, { method: "GET" }).then(response => {
await fetch(`http://${'transcendance'}:${'8080'}/api/v2/user/avatar`, { method: "GET" }).then(response => {
return response.blob();
}).then(data => {
const url = URL.createObjectURL(data);
@@ -13597,7 +13597,7 @@ var app = (function () {
let { $$slots: slots = {}, $$scope } = $$props;
validate_slots('Chat', slots, []);
let { color = "transparent" } = $$props;
const socket = lookup(`http://${'localhost'}:${'8080'}`, { path: '/chat' });
const socket = lookup(`http://${'transcendance'}:${'8080'}`, { path: '/chat' });
onMount(async => {
socket.on('connect', function () {
@@ -13894,7 +13894,7 @@ var app = (function () {
onMount(async () => {
// console.log('mounting profile display')
$$invalidate(0, user = await fetch(`http://${'localhost'}:${'8080'}/api/v2/user`).then(x => x.json()));
$$invalidate(0, user = await fetch(`http://${'transcendance'}:${'8080'}/api/v2/user`).then(x => x.json()));
});
const writable_props = [];
@@ -14727,7 +14727,7 @@ var app = (function () {
let success = { username: '', avatar: '' };
onMount(async () => {
user = await fetch(`http://${'localhost'}:${'8080'}/api/v2/user`).then(x => x.json());
user = await fetch(`http://${'transcendance'}:${'8080'}/api/v2/user`).then(x => x.json());
// do a .catch?
if (user === undefined) {
@@ -14743,7 +14743,7 @@ var app = (function () {
// tmp
// console.log('this is what is in the avatar before fetch')
// console.log(avatar)
await fetch(`http://${'localhost'}:${'8080'}/api/v2/user/avatar`, { method: "GET" }).then(response => {
await fetch(`http://${'transcendance'}:${'8080'}/api/v2/user/avatar`, { method: "GET" }).then(response => {
return response.blob();
}).then(data => {
const url = URL.createObjectURL(data);
@@ -14768,7 +14768,7 @@ var app = (function () {
$$invalidate(4, errors.username = '', errors);
}
await fetch(`http://${'localhost'}:${'8080'}/api/v2/user`, {
await fetch(`http://${'transcendance'}:${'8080'}/api/v2/user`, {
method: 'PATCH',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
@@ -14795,7 +14795,7 @@ var app = (function () {
// tmp
console.log(data);
const responseWhenChangeAvatar = fetch(`http://${'localhost'}:${'8080'}/api/v2/user/avatar`, { method: 'POST', body: data });
const responseWhenChangeAvatar = fetch(`http://${'transcendance'}:${'8080'}/api/v2/user/avatar`, { method: 'POST', body: data });
const responseFromServer = await responseWhenChangeAvatar;
if (responseFromServer.ok === true) {
@@ -14805,7 +14805,7 @@ var app = (function () {
$$invalidate(4, errors.avatar = responseFromServer.statusText, errors);
}
await fetch(`http://${'localhost'}:${'8080'}/api/v2/user/avatar`, { method: "GET" }).then(response => {
await fetch(`http://${'transcendance'}:${'8080'}/api/v2/user/avatar`, { method: "GET" }).then(response => {
return response.blob();
}).then(data => {
const url = URL.createObjectURL(data);
@@ -15106,15 +15106,15 @@ var app = (function () {
onMount(async () => {
console.log('Display aUser username: ' + aUsername);
//`http://${'localhost'}:${'8080'}/api/v2/user?username=NomDuUserATrouve`
$$invalidate(1, user = await fetch(`http://${'localhost'}:${'8080'}/api/v2/user?username=${aUsername}`).then(x => x.json()));
//`http://${'transcendance'}:${'8080'}/api/v2/user?username=NomDuUserATrouve`
$$invalidate(1, user = await fetch(`http://${'transcendance'}:${'8080'}/api/v2/user?username=${aUsername}`).then(x => x.json()));
});
const updateUser = async updatedUser => {
console.log('Display Update aUser username: ' + updateUser);
//`http://${'localhost'}:${'8080'}/api/v2/user?username=NomDuUserATrouve`
$$invalidate(1, user = await fetch(`http://${'localhost'}:${'8080'}/api/v2/user?username=${updateUser}`).then(x => x.json()));
//`http://${'transcendance'}:${'8080'}/api/v2/user?username=NomDuUserATrouve`
$$invalidate(1, user = await fetch(`http://${'transcendance'}:${'8080'}/api/v2/user?username=${updateUser}`).then(x => x.json()));
};
$$self.$$.on_mount.push(function () {
@@ -15615,23 +15615,23 @@ var app = (function () {
let userBeingViewed;
onMount(async () => {
user = await fetch(`http://${'localhost'}:${'8080'}/api/v2/user`).then(x => x.json());
myFriends = await fetch(`http://${'localhost'}:${'8080'}/api/v2/network/myfriends`).then(x => x.json());
requestsMade = await fetch(`http://${'localhost'}:${'8080'}/api/v2/network/pending`).then(x => x.json());
requestsRecieved = await fetch(`http://${'localhost'}:${'8080'}/api/v2/network/received`).then(x => x.json());
$$invalidate(0, allUsers = await fetch(`http://${'localhost'}:${'8080'}/api/v2/user/all`).then(x => x.json()));
user = await fetch(`http://${'transcendance'}:${'8080'}/api/v2/user`).then(x => x.json());
myFriends = await fetch(`http://${'transcendance'}:${'8080'}/api/v2/network/myfriends`).then(x => x.json());
requestsMade = await fetch(`http://${'transcendance'}:${'8080'}/api/v2/network/pending`).then(x => x.json());
requestsRecieved = await fetch(`http://${'transcendance'}:${'8080'}/api/v2/network/received`).then(x => x.json());
$$invalidate(0, allUsers = await fetch(`http://${'transcendance'}:${'8080'}/api/v2/user/all`).then(x => x.json()));
});
const displayAllUsers = async () => {
$$invalidate(0, allUsers = await fetch(`http://${'localhost'}:${'8080'}/api/v2/user/all`).then(x => x.json()));
$$invalidate(0, allUsers = await fetch(`http://${'transcendance'}:${'8080'}/api/v2/user/all`).then(x => x.json()));
}; // console.log('got all users ' + allUsers)
const displayAllFriends = async () => {
myFriends = await fetch(`http://${'localhost'}:${'8080'}/api/v2/network/myfriends`).then(x => x.json());
myFriends = await fetch(`http://${'transcendance'}:${'8080'}/api/v2/network/myfriends`).then(x => x.json());
}; // console.log('got all friends ' + allFriends)
const displayRequestsMade = async () => {
requestsMade = await fetch(`http://${'localhost'}:${'8080'}/api/v2/network/pending`).then(x => x.json());
requestsMade = await fetch(`http://${'transcendance'}:${'8080'}/api/v2/network/pending`).then(x => x.json());
}; // console.log('got requests made ' + requestsMade)
let sentFriendRequest;
@@ -15650,7 +15650,7 @@ var app = (function () {
}
if (valid) {
sentFriendRequest = await fetch(`http://${'localhost'}:${'8080'}/api/v2/network/myfriends`, {
sentFriendRequest = await fetch(`http://${'transcendance'}:${'8080'}/api/v2/network/myfriends`, {
method: "POST",
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
@@ -15666,7 +15666,7 @@ var app = (function () {
$$invalidate(1, userBeingViewed = aUser);
}; // sendUsername = userBeingViewed.username;
// prolly like fetch if you're friends or not?
// GET `http://${'localhost'}:${'8080'}/api/v2/networks/myfriends?username=aUser` but i need to make that as long as Cherif
// GET `http://${'transcendance'}:${'8080'}/api/v2/networks/myfriends?username=aUser` but i need to make that as long as Cherif
// doesn't have a better option
// like i want this thing to return the Friendship ID ideally
@@ -16273,7 +16273,7 @@ var app = (function () {
let user;
onMount(async () => {
$$invalidate(0, user = await fetch(`http://${'localhost'}:${'8080'}/api/v2/user`).then(resp => resp.json()));
$$invalidate(0, user = await fetch(`http://${'transcendance'}:${'8080'}/api/v2/user`).then(resp => resp.json()));
// i mean i could do a failed to load user or some shit, maybe with a .catch or something? but atm why bother
console.log('User var');
@@ -16294,14 +16294,14 @@ var app = (function () {
});
const login = async () => {
window.location.href = `http://${'localhost'}:${'8080'}/api/v2/auth`;
window.location.href = `http://${'transcendance'}:${'8080'}/api/v2/auth`;
console.log('you are now logged in');
};
// i could prolly put this in it's own compoent, i seem to use it in several places... or maybe just some JS? like no need for html
// we could .then( () => replace('/') ) need the func so TS compatible...
const logout = async () => {
await fetch(`http://${'localhost'}:${'8080'}/api/v2/auth/logout`, { method: 'POST' });
await fetch(`http://${'transcendance'}:${'8080'}/api/v2/auth/logout`, { method: 'POST' });
$$invalidate(0, user = undefined);
};
@@ -16635,7 +16635,7 @@ var app = (function () {
let wrongCode = "";
const fetchQrCodeImg = (async () => {
await fetch(`http://${'localhost'}:${'8080'}/api/v2/auth/2fa/generate`, { method: 'POST' }).then(response => {
await fetch(`http://${'transcendance'}:${'8080'}/api/v2/auth/2fa/generate`, { method: 'POST' }).then(response => {
return response.blob();
}).then(blob => {
const url = URL.createObjectURL(blob);
@@ -16644,7 +16644,7 @@ var app = (function () {
})();
const submitCode = async () => {
const response = await fetch(`http://${'localhost'}:${'8080'}/api/v2/auth/2fa/check`, {
const response = await fetch(`http://${'transcendance'}:${'8080'}/api/v2/auth/2fa/check`, {
method: 'POST',
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ "twoFaCode": qrCode })
@@ -17025,10 +17025,10 @@ var app = (function () {
// export const soundPongArr: HTMLAudioElement[] = [];
const soundPongArr = [
new Audio("http://" + 'localhost' + ":" + '8080' + "/sound/pong/" + 1 + ".ogg"),
new Audio("http://" + 'localhost' + ":" + '8080' + "/sound/pong/" + 2 + ".ogg")
new Audio("http://" + 'transcendance' + ":" + '8080' + "/sound/pong/" + 1 + ".ogg"),
new Audio("http://" + 'transcendance' + ":" + '8080' + "/sound/pong/" + 2 + ".ogg")
];
const soundRoblox = new Audio("http://" + 'localhost' + ":" + '8080' + "/sound/roblox-oof.ogg");
const soundRoblox = new Audio("http://" + 'transcendance' + ":" + '8080' + "/sound/roblox-oof.ogg");
function initAudio(sound) {
let muteFlag;
if (sound === "on") {
@@ -17118,7 +17118,7 @@ var app = (function () {
}
class ClientInfoSpectator {
}
const wsUrl = "ws://" + 'localhost' + ":" + '8080' + "/pong";
const wsUrl = "ws://" + 'transcendance' + ":" + '8080' + "/pong";
let socket; /* TODO: A way to still use "const" not "let" ? */
const clientInfo = new ClientInfo();
const clientInfoSpectator = new ClientInfoSpectator(); // WIP, could refactor this
@@ -19270,8 +19270,8 @@ var app = (function () {
let idOfIntevalCheckTerminationOfTheMatch;
onMount(async () => {
$$invalidate(12, user = await fetch(`http://${'localhost'}:${'8080'}/api/v2/user`).then(x => x.json()));
$$invalidate(0, allUsers = await fetch(`http://${'localhost'}:${'8080'}/api/v2/user/all`).then(x => x.json()));
$$invalidate(12, user = await fetch(`http://${'transcendance'}:${'8080'}/api/v2/user`).then(x => x.json()));
$$invalidate(0, allUsers = await fetch(`http://${'transcendance'}:${'8080'}/api/v2/user/all`).then(x => x.json()));
$$invalidate(2, options.playerOneUsername = user.username, options);
});
@@ -19285,7 +19285,7 @@ var app = (function () {
$$invalidate(3, showWaitPage = true);
const matchOptions = computeMatchOptions(options);
const responseWhenGrantToken = fetch(`http://${'localhost'}:${'8080'}/api/v2/game/ticket`, {
const responseWhenGrantToken = fetch(`http://${'transcendance'}:${'8080'}/api/v2/game/ticket`, {
method: "POST",
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
@@ -19383,7 +19383,7 @@ var app = (function () {
const showInvitation = async () => {
$$invalidate(5, showGameOption = false);
$$invalidate(4, showInvitations = true);
$$invalidate(10, invitations = await fetch(`http://${'localhost'}:${'8080'}/api/v2/game/invitations`).then(x => x.json()));
$$invalidate(10, invitations = await fetch(`http://${'transcendance'}:${'8080'}/api/v2/game/invitations`).then(x => x.json()));
invitations.length !== 0
? $$invalidate(9, isThereAnyInvitation = true)
@@ -19391,7 +19391,7 @@ var app = (function () {
};
const rejectInvitation = async invitation => {
await fetch(`http://${'localhost'}:${'8080'}/api/v2/game/decline`, {
await fetch(`http://${'transcendance'}:${'8080'}/api/v2/game/decline`, {
method: "POST",
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ token: invitation.token })
@@ -19401,7 +19401,7 @@ var app = (function () {
};
const acceptInvitation = async invitation => {
const res = await fetch(`http://${'localhost'}:${'8080'}/api/v2/game/accept`, {
const res = await fetch(`http://${'transcendance'}:${'8080'}/api/v2/game/accept`, {
method: "POST",
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ token: invitation.token })
@@ -19987,8 +19987,8 @@ var app = (function () {
let idInterval;
onMount(async () => {
$$invalidate(0, currentUser = await fetch(`http://${'localhost'}:${'8080'}/api/v2/user`).then(x => x.json()));
$$invalidate(1, allUsers = await fetch(`http://${'localhost'}:${'8080'}/api/v2/game/ranking`).then(x => x.json()));
$$invalidate(0, currentUser = await fetch(`http://${'transcendance'}:${'8080'}/api/v2/user`).then(x => x.json()));
$$invalidate(1, allUsers = await fetch(`http://${'transcendance'}:${'8080'}/api/v2/game/ranking`).then(x => x.json()));
idInterval = setInterval(fetchScores, 10000);
});
@@ -19997,7 +19997,7 @@ var app = (function () {
});
function fetchScores() {
fetch(`http://${'localhost'}:${'8080'}/api/v2/game/ranking`).then(x => x.json()).then(x => $$invalidate(1, allUsers = x));
fetch(`http://${'transcendance'}:${'8080'}/api/v2/game/ranking`).then(x => x.json()).then(x => $$invalidate(1, allUsers = x));
}
const writable_props = [];
@@ -20830,11 +20830,11 @@ var app = (function () {
let hiddenMatchList = false;
onMount(async () => {
user = await fetch(`http://${'localhost'}:${'8080'}/api/v2/user`).then(x => x.json());
allUsers = await fetch(`http://${'localhost'}:${'8080'}/api/v2/user/all`).then(x => x.json());
user = await fetch(`http://${'transcendance'}:${'8080'}/api/v2/user`).then(x => x.json());
allUsers = await fetch(`http://${'transcendance'}:${'8080'}/api/v2/user/all`).then(x => x.json());
// WIP: fetch for match list here
const responseForMatchList = await fetch(`http://${'localhost'}:${'8080'}/api/v2/game/match/all`);
const responseForMatchList = await fetch(`http://${'transcendance'}:${'8080'}/api/v2/game/match/all`);
const jsonForMatchList = await responseForMatchList.json();
$$invalidate(1, matchList = jsonForMatchList);
@@ -20861,7 +20861,7 @@ var app = (function () {
destroy();
// WIP: fetch for match list here
$$invalidate(1, matchList = await fetch(`http://${'localhost'}:${'8080'}/api/v2/game/match/all`).then(x => x.json()));
$$invalidate(1, matchList = await fetch(`http://${'transcendance'}:${'8080'}/api/v2/game/match/all`).then(x => x.json()));
console.log("matchList");
if (matchList.length <= 0) $$invalidate(3, hiddenMatchList = true);
@@ -20956,7 +20956,7 @@ var app = (function () {
component: ProfilePage,
conditions: [
async(detail) => {
const user = await fetch('http://' + 'localhost' + ":" + '8080' + '/api/v2/user')
const user = await fetch('http://' + 'transcendance' + ":" + '8080' + '/api/v2/user')
.then((resp) => resp.json());
console.log('in /profile what is in user');
@@ -20973,7 +20973,7 @@ var app = (function () {
component: ProfilePage,
conditions: [
async(detail) => {
const user = await fetch('http://' + 'localhost' + ":" + '8080' + '/api/v2/user')
const user = await fetch('http://' + 'transcendance' + ":" + '8080' + '/api/v2/user')
.then((resp) => resp.json());
console.log('in /profile/* what is in user');

File diff suppressed because one or more lines are too long