diff --git a/dev/View/Popup/FolderCreate.js b/dev/View/Popup/FolderCreate.js index cbc79b5cc..9087a8690 100644 --- a/dev/View/Popup/FolderCreate.js +++ b/dev/View/Popup/FolderCreate.js @@ -1,13 +1,11 @@ import { koComputable, addObservablesTo } from 'External/ko'; import { Notification } from 'Common/Enums'; -import { UNUSED_OPTION_VALUE } from 'Common/Consts'; import { defaultOptionsAfterRender } from 'Common/Utils'; import { folderListOptionsBuilder, sortFolders } from 'Common/Folders'; import { getNotification } from 'Common/Translator'; import { FolderUserStore } from 'Stores/User/Folder'; -//import { SettingsUserStore } from 'Stores/User/Settings'; import Remote from 'Remote/User/Fetch'; @@ -21,10 +19,9 @@ export class FolderCreatePopupView extends AbstractViewPopup { super('FolderCreate'); addObservablesTo(this, { - folderName: '', - folderSubscribe: true,//SettingsUserStore.hideUnsubscribed(), - - selectedParentValue: UNUSED_OPTION_VALUE + name: '', + subscribe: true, + parentFolder: '' }); this.parentFolderSelectList = koComputable(() => @@ -46,9 +43,8 @@ export class FolderCreatePopupView extends AbstractViewPopup { submitForm(form) { if (form.reportValidity()) { const data = new FormData(form); - data.set('subscribe', this.folderSubscribe() ? 1 : 0); - let parentFolderName = this.selectedParentValue(); + let parentFolderName = this.parentFolder(); if (!parentFolderName && 1 < FolderUserStore.namespace.length) { data.set('parent', FolderUserStore.namespace.slice(0, FolderUserStore.namespace.length - 1)); } @@ -79,7 +75,8 @@ export class FolderCreatePopupView extends AbstractViewPopup { } onShow() { - this.folderName(''); - this.selectedParentValue(''); + this.name(''); + this.subscribe(true); + this.parentFolder(''); } } diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Folders.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Folders.php index ae3349deb..e964e52c1 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Folders.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Folders.php @@ -91,7 +91,7 @@ trait Folders $oFolder = $this->MailClient()->FolderCreate( $this->GetActionParam('folder', ''), $this->GetActionParam('parent', ''), - !!$this->GetActionParam('subscribe', 1) + !empty($this->GetActionParam('subscribe', 0)) ); // FolderInformation(string $sFolderName, int $iPrevUidNext = 0, array $aUids = array()) @@ -121,7 +121,7 @@ trait Folders $this->initMailClientConnection(); $sFolderFullName = $this->GetActionParam('folder', ''); - $bSubscribe = '1' === (string) $this->GetActionParam('subscribe', '0'); + $bSubscribe = !empty($this->GetActionParam('subscribe', 0)); try { @@ -183,7 +183,7 @@ trait Folders $this->MailClient()->FolderMove( $this->GetActionParam('folder', ''), $this->GetActionParam('newFolder', ''), - !!$this->GetActionParam('subscribe', 1) + !empty($this->GetActionParam('subscribe', 1)) ); } catch (\Throwable $oException) @@ -207,7 +207,7 @@ trait Folders $sFullName = $this->MailClient()->FolderRename( $this->GetActionParam('folder', ''), $sName, - !!$this->GetActionParam('subscribe', 1) + !empty($this->GetActionParam('subscribe', 1)) ); } catch (\Throwable $oException) diff --git a/snappymail/v/0.0.0/app/templates/Views/User/PopupsFolderCreate.html b/snappymail/v/0.0.0/app/templates/Views/User/PopupsFolderCreate.html index 1ae50e5fc..3d45ab8b3 100644 --- a/snappymail/v/0.0.0/app/templates/Views/User/PopupsFolderCreate.html +++ b/snappymail/v/0.0.0/app/templates/Views/User/PopupsFolderCreate.html @@ -5,21 +5,21 @@