Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
creationHandler () {
var TTT = this
globalStore.commit('SET_APIFN', TTT.$callDockjobAPI)
if (globalStore.getters.datastoreState === 'INITIAL') {
Loading.show()
var callback = {
ok: function (response) {
Loading.hide()
if (globalStore.getters.datastoreState === 'INITIAL') {
console.log('Error state STILL initial - stopping infinite loop')
} else {
// TTT.$router.replace(TTT.$route.query.redirect || '/')
TTT.creationHandler()
}
},
error: function (response) {
Loading.hide()
console.log('Error frontend connection data state: ' + response.message)
Notify.create(response.message)
}
}
creationHandler () {
var TTT = this
if (globalStore.getters.datastoreState === 'INITIAL') {
Loading.show()
var callback = {
ok: function (response) {
Loading.hide()
if (globalStore.getters.datastoreState === 'INITIAL') {
console.log('Error state STILL initial - stopping infinite loop')
}
else {
// TTT.$router.replace(TTT.$route.query.redirect || '/')
TTT.creationHandler()
}
},
error: function (response) {
Loading.hide()
console.log('Error frontend connection data state: ' + response.message)
Toast.create(response.message)
}
async function processBooking({ chargeToken, outboundFlight }) {
const processBookingInput = {
input: {
paymentToken: chargeToken,
bookingOutboundFlightId: outboundFlight.id
}
};
try {
Loading.show({
message: "Creating a new booking..."
});
const {
// @ts-ignore
data: {
processBooking: { id: bookingProcessId }
}
} = await API.graphql(
graphqlOperation(processBookingMutation, processBookingInput)
);
return bookingProcessId;
} catch (err) {
console.error(err);
throw err;
speech.addEventListener('start', () => {
Loading.show({
delay: 0,
spinner: QSpinnerAudio, // ms,
backgroundColor: 'primary'
})
})
axios.interceptors.request.use(function (config) {
Loading.show()
return config
}, function (error) {
Loading.hide()
async function processPayment({
endpoint,
paymentToken,
outboundFlight,
customerEmail
}) {
Loading.show({
message: "Charging a pre-authorization..."
});
if (!paymentToken) throw "Invalid payment token";
const chargeData = {
amount: outboundFlight.ticketPrice,
currency: outboundFlight.ticketCurrency,
stripeToken: paymentToken.details.id,
description: `Payment by ${customerEmail}`,
email: customerEmail
};
try {
const data = await axios.post(endpoint, chargeData);
const {
export default (logoutType) => {
Loading.show()
deleteFcmToken()
.then(success => firebaseLogout())
.then(success => apiLogout(logoutType))
.then(success => backendLogout())
.then(success => clear())
.then(success => {
Loading.hide()
}).catch(error => {
Loading.hide()
errorHandler(this, error)
})
}
function show (options, timeout = 3000) {
Loading.show(options)
setTimeout(() => {
Loading.hide()
}, timeout)
}
async signInWithGoogle() {
Loading.show()
const state = base64url.encode(
this.$store.getters['oauthToken/requestedPath']
)
const acceptJson = new Headers()
acceptJson.set('Accept', 'application/json')
acceptJson.set('Authorization', 'Basic b2lkY19pZDphcHBfc2VjcmV0')
let response = await fetch(
process.env.GATEWAY_URI + '/oidc/auth-info/google?state=' + state,
{ headers: acceptJson }
)
let data = await response.json()
this.oidcUri = data.uri
window.location.href = this.oidcUri
},
noop() {}