mirror of
https://github.com/janishutz/libreevent.git
synced 2025-11-25 13:24:24 +00:00
various bugfixes
This commit is contained in:
@@ -61,15 +61,15 @@ if ( settings.init ) {
|
||||
|
||||
console.log( '[ Server ] loading and initializing middlewares' );
|
||||
// initialise express with middlewares
|
||||
// TODO: Generate random token
|
||||
// TODO: Generate random secret
|
||||
app.use( expressSession( {
|
||||
secret: 'gaoevgoawefgo083tq2rfvöfaf0p8',
|
||||
resave: true,
|
||||
resave: false,
|
||||
saveUninitialized: true,
|
||||
cookie: {
|
||||
sameSite: 'none',
|
||||
httpOnly: true,
|
||||
secure: true,
|
||||
httpOnly: false,
|
||||
secure: false,
|
||||
}
|
||||
} ) );
|
||||
|
||||
|
||||
@@ -29,7 +29,9 @@ class GETHandler {
|
||||
} else if ( call === 'getReservedSeats' ) {
|
||||
if ( query.event ) {
|
||||
db.getJSONDataSimple( 'booked', query.event ).then( data => {
|
||||
console.log( session.id );
|
||||
db.getDataSimple( 'temp', 'user_id', session.id ).then( dat => {
|
||||
console.log( dat );
|
||||
resolve( { 'booked': data ? data.booked : {}, 'user': dat[ 0 ] ? JSON.parse( dat[ 0 ].data )[ query.event ] ?? {} : {} } );
|
||||
} );
|
||||
} ).catch( error => {
|
||||
|
||||
@@ -60,6 +60,7 @@ class POSTHandler {
|
||||
} else {
|
||||
this.allSelectedSeats[ data.eventID ].push( { 'id': data.id, 'component': data.component } );
|
||||
}
|
||||
console.log( { 'user_id': session.id, 'data': JSON.stringify( transmit ), 'timestamp': new Date().toString() } );
|
||||
db.writeDataSimple( 'temp', 'user_id', session.id, { 'user_id': session.id, 'data': JSON.stringify( transmit ), 'timestamp': new Date().toString() } ).then( () => {
|
||||
resolve( 'ok' );
|
||||
} ).catch( () => {
|
||||
|
||||
@@ -131,7 +131,6 @@ export default {
|
||||
},
|
||||
watch: {
|
||||
scaleFactor() {
|
||||
console.log( 'scaleFactor' );
|
||||
this.setScaleFactor();
|
||||
},
|
||||
h() {
|
||||
@@ -144,7 +143,6 @@ export default {
|
||||
this.calculateChairs();
|
||||
},
|
||||
unavailable() {
|
||||
console.log( 'updating' );
|
||||
this.calculateChairs();
|
||||
}
|
||||
},
|
||||
|
||||
@@ -158,6 +158,7 @@
|
||||
this.seatChecks();
|
||||
// TODO: Optimise for odd screen sizes and aspect ratios and fucking webkit
|
||||
// TODO: Trim scroll box to about 200px more than seatplan size
|
||||
sessionStorage.setItem( 'seatplan', JSON.stringify( this.scaleDown( this.draggables ) ) );
|
||||
window.addEventListener( 'visibilitychange', ( e ) => {
|
||||
this.seatPlanInit();
|
||||
}, 1 );
|
||||
@@ -170,6 +171,7 @@
|
||||
if ( res.status === 200 ) {
|
||||
let unavailableSeats = {};
|
||||
res.json().then( data => {
|
||||
console.log( data );
|
||||
for ( let seat in data.booked ) {
|
||||
if ( !unavailableSeats[ data.booked[ seat ].component ] ) {
|
||||
unavailableSeats[ data.booked[ seat ].component ];
|
||||
@@ -383,6 +385,10 @@
|
||||
setTimeout( () => {
|
||||
this.$refs.popups.openPopup( 'Unfortunately, the seat you just tried to select was reserved by somebody else since the last time the seat plan was refreshed. Please select another one. We are sorry for the inconvenience.', {}, 'string' );
|
||||
}, 300 );
|
||||
} else if ( res.status === 418 ) {
|
||||
setTimeout( () => {
|
||||
this.$refs.popups.openPopup( 'We are sorry, but you have already selected the maximum amount of tickets you can buy.', {}, 'string' );
|
||||
}, 300 );
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ app.use( createPinia() );
|
||||
|
||||
let userStore = useUserStore();
|
||||
|
||||
let prod = false;
|
||||
let prod = true;
|
||||
|
||||
if ( prod ) {
|
||||
fetch( '/api/getAuth' ).then( res => {
|
||||
|
||||
Reference in New Issue
Block a user