Skip to content

Commit

Permalink
fix: prevent losing filters settings after disconnecting the api key, f…
Browse files Browse the repository at this point in the history
…ix #210

Co-authored-by: GrigoreMihai <40674950+GrigoreMihai@users.noreply.github.com>
  • Loading branch information
2 people authored and selul committed Jan 14, 2020
1 parent 3ce5da7 commit db431b9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions inc/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -402,9 +402,12 @@ public function get_cdn_url() {
* @return bool Reset action status.
*/
public function reset() {
$update = update_option( $this->namespace, $this->default_schema );
$reset_schema = $this->default_schema;
$reset_schema['filters'] = $this->options['filters'];

$update = update_option( $this->namespace, $reset_schema );
if ( $update ) {
$this->options = $this->default_schema;
$this->options = $reset_schema;
}

return $update;
Expand Down

0 comments on commit db431b9

Please sign in to comment.