<commit_before>import Ember from "ember";
import config from '../config/environment';

export default Ember.Component.extend({
	didInsertElement: function() {
		this._super();
		this.set("error_message", undefined);
	  	this.resizeBody();
	  	var self = this;
	  	Ember.$(window).on("window:resize", function() {
	  		self.resizeBody();
	  	});
	},
	actions: {
		logout: function() {
			Ember.$.ajax({
                url: config.API_LOC + "/logout",
                data: {},
                contentType: "application/json",
                type: 'GET'
            });
			this.get('session').invalidate();
		}
	},
	resizeBody: function() {
		if(this.get("session.current_user.admin")) {
			console.log("Admin!");
	     	Ember.$('body').css("padding-top", Ember.$("#navbar").height() + 150);
	  	}
	  	else {
	  		console.log("User!");
	  		Ember.$('body').css("padding-top", Ember.$("#navbar").height()+30);<commit_msg>Change sending of the logout request<commit_after>import Ember from "ember";
import config from '../config/environment';

export default Ember.Component.extend({
	didInsertElement: function() {
		this._super();
		this.set("error_message", undefined);
	  	this.resizeBody();
	  	var self = this;
	  	Ember.$(window).on("window:resize", function() {
	  		self.resizeBody();
	  	});
	},
	actions: {
		logout: function() {
			var self = this;
			Ember.$.ajax({
                url: config.API_LOC + "/logout",
                data: {},
                contentType: "application/json",
                type: 'GET',
                success: function() {
                	self.get("session").invalidate();
                },
                error: function() {
                	self.get("session").invalidate();
                }
            });
		}
	},
	resizeBody: function() {
		if(this.get("session.current_user.admin")) {
			console.log("Admin!");
	     	Ember.$('body').css("padding-top", Ember.$("#navbar").height() + 150);
	  	}
	  	else {
	  		console.log("User!");
	  		Ember.$('body').css("padding-top", Ember.$("#navbar").height()+30);
{'fraction_non_alphanumeric': 0.19077669902912622, 'fraction_numerical': 0.0048543689320388345, 'mean_word_length': 2.3953871499176276, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3609206', 'n_tokens_mistral': 701, 'n_tokens_neox': 634, 'n_words': 106}