odoo.define('jd_theme.sidebar-toggle', function (require) {
    "use strict";

    var session = require('web.session');
    var Model = require('web.DataModel');

    var id = session.uid;

    new Model('res.users').query(['sidebar_visible'])
        .filter([['id', '=', id]])
        .first()
        .then(function (res) {
            if (res) {
                var toggle = res["sidebar_visible"];
                if (toggle === true) {
                    $("#app-sidebar").removeClass("toggle-sidebar");
                } else {
                    $("#app-sidebar").addClass("toggle-sidebar");
                }
                ;
            }
        });
});
