mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-12 16:52:50 +00:00
lint: remove unused code, code style and early update cached username
This commit is contained in:
@@ -12,7 +12,6 @@ import planePhotoFrame from './plane_photo';
|
||||
|
||||
const apiUrl = 'https://api.panoramax.xyz/';
|
||||
const tileUrl = apiUrl + 'api/map/{z}/{x}/{y}.mvt';
|
||||
const imageBlobUrl = apiUrl + 'api/pictures/{pictureID}/{definition}.jpg';
|
||||
const imageDataUrl = apiUrl + 'api/collections/{collectionId}/items/{itemId}';
|
||||
const userIdUrl = apiUrl + 'api/users/search?q={username}';
|
||||
const usernameURL = apiUrl + 'api/users/{userId}';
|
||||
@@ -199,14 +198,6 @@ function loadTileDataToCache(data, tile) {
|
||||
}
|
||||
}
|
||||
|
||||
// Quick access to image
|
||||
function getImageURL(image_id, definition){
|
||||
const requestUrl = imageBlobUrl.replace('{pictureID}', image_id)
|
||||
.replace('{definition}', definition);
|
||||
|
||||
return requestUrl;
|
||||
}
|
||||
|
||||
async function getImageData(collection_id, image_id){
|
||||
const requestUrl = imageDataUrl.replace('{collectionId}', collection_id)
|
||||
.replace('{itemId}', image_id);
|
||||
@@ -281,6 +272,7 @@ export default {
|
||||
const responses = await Promise.all(requestUrls.map(requestUrl =>
|
||||
fetch(requestUrl, { method: 'GET' })));
|
||||
if (responses.some(response => !response.ok)) {
|
||||
const response = responses.find(response => !response.ok);
|
||||
throw new Error(response.status + ' ' + response.statusText);
|
||||
}
|
||||
const data = await Promise.all(responses.map(response => response.json()));
|
||||
|
||||
@@ -65,13 +65,14 @@ export function svgPanoramaxImages(projection, context, dispatch) {
|
||||
}
|
||||
if (username && service) {
|
||||
if (_activeUsernameFilter !== username) {
|
||||
_activeUsernameFilter = username;
|
||||
|
||||
const tempIds = await service.getUserIds(username);
|
||||
|
||||
_activeUsernameFilter = username;
|
||||
_activeIds = {};
|
||||
tempIds.forEach(id => {
|
||||
_activeIds[id] = true;
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
images = images.filter(function(image) {
|
||||
@@ -109,13 +110,14 @@ export function svgPanoramaxImages(projection, context, dispatch) {
|
||||
}
|
||||
if (username && service) {
|
||||
if (_activeUsernameFilter !== username) {
|
||||
_activeUsernameFilter = username;
|
||||
|
||||
const tempIds = await service.getUserIds(username);
|
||||
|
||||
_activeUsernameFilter = username;
|
||||
_activeIds = {};
|
||||
tempIds.forEach(id => {
|
||||
_activeIds[id] = true;
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
sequences = sequences.filter(function(sequence) {
|
||||
|
||||
Reference in New Issue
Block a user