Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
paulosabayomi committed Mar 7, 2024
1 parent f565742 commit 88ba478
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 1.1.7 (2024-03-06)

- Fix: `file_upload_settings` not getting updated when set with `setOptions`, fixed it by calling the configure axios method

## 1.1.6 (2024-03-06)

- Fix: An undefined variable bug caused by the method that returns the attached form field as an HTML element or undefined if not provided.
Expand Down
7 changes: 0 additions & 7 deletions core/custupCore.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,13 +229,6 @@ export default class CustUpCore extends EventTarget {
link: string;
clipboard: string;
google_drive: string;
/**
* @protected @method show_message
* @param {string} msg
* @param {"error" | "success" | "info"} type
* @param {boolean} async - for async messages that doesn't hide until the request is done
* @param {number} timeout - timeout for hiding the message
*/
dropbox: string;
box_icon: string;
onedrive: string;
Expand Down
2 changes: 1 addition & 1 deletion core/custupCore.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions core/custupCore.js
Original file line number Diff line number Diff line change
Expand Up @@ -519,13 +519,19 @@ export default class CustUpCore extends EventTarget {
}
}

if (key == "file_upload_settings") {
console.log("file_upload_settings",this.options[key] );
}

if (no_update) continue;

// update items that needs to be updated
if (key === 'file_preview_animation_types') {
this.set_file_preview_animations(true); // load animations
}else if (key === 'default_files') {
this.load_default_files();
}else if (key === 'file_upload_settings') {
this.configure_axios();
}else if (key === 'default_icons_override') {
this.map_override_icons_to_default_icons();
}else if (key === "default_styles_override" || key === "persist_styles_override_across_instances") {
Expand Down Expand Up @@ -1959,6 +1965,7 @@ export default class CustUpCore extends EventTarget {
* @protected @method configure_axios
*/
configure_axios () {
console.log("config axios file_upload_settings", this.options.file_upload_settings.endpoint_url);
this.__axios_instance = axios.create({
baseURL: this.options.file_upload_settings.endpoint_url,
timeout: 2000000,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "custup",
"version": "1.1.6",
"version": "1.1.7",
"description": "Highly customisable file upload library with zero dependencies",
"main": "src/custup.min.js",
"scripts": {
Expand Down

0 comments on commit 88ba478

Please sign in to comment.